Add 'readonly' attribute to schema fields
[civicrm-core.git] / Civi / Api4 / Service / Spec / FieldSpec.php
index 0d503ad748b29d15fd346989b1d39000d8709a52..3aa807a5725715847070e5a7e6c3bf1ee1ab1a30 100644 (file)
@@ -112,6 +112,11 @@ class FieldSpec {
    */
   protected $columnName;
 
+  /**
+   * @var bool
+   */
+  protected $readonly = FALSE;
+
   /**
    * Aliases for the valid data types
    *
@@ -361,6 +366,23 @@ class FieldSpec {
     return $this;
   }
 
+  /**
+   * @return bool
+   */
+  public function getreadonly() {
+    return $this->readonly;
+  }
+
+  /**
+   * @param bool $readonly
+   * @return $this
+   */
+  public function setreadonly($readonly) {
+    $this->readonly = (bool) $readonly;
+
+    return $this;
+  }
+
   /**
    * @return string|NULL
    */