Jake Vanderwerf
2026-05-01 48721c85ebcfa973ee81719d2467ca80e4253dc9
inc/registrar/fields/Field.php
@@ -20,6 +20,7 @@
   protected bool $quill;           // whether to use quill
   protected int $maxLength;        // of characters
   protected string $subtype;
   protected array $condition;
   protected array $allowedSubtype = ['text', 'url','number','tel','email','number'];
   /**
    * @var ?bool For timeline post types. Indicates whether all posts get this field, or just the parent
@@ -55,7 +56,7 @@
            $method = 'set'.implode('',array_map('ucfirst',explode('_', $key)));;
            $class->$method($value);
         } else {
            error_log('Instance: '.print_r($class, true));
//          error_log('Instance: '.print_r($class, true));
            error_log('[JVBase\registrar\Field] Invalid key for '.$name.': '.$key);
         }
      }
@@ -78,7 +79,7 @@
      return $this->hint;
   }
   protected function setType(string $type):void{
   public function setType(string $type):void{
      $allowed = array_keys(MetaTypeManager::getTypes());
      if (!in_array($type, $allowed)) {
         error_log('[JVBase\registrar\Field] Invalid type attempted '.$type);
@@ -87,24 +88,24 @@
      $this->type = $type;
   }
   protected function setLabel(string $label):void{
   public function setLabel(string $label):void{
      $this->label = $label;
   }
   protected function setRequired(bool $required):void{
   public function setRequired(bool $required):void{
      $this->required = $required;
   }
   protected function setHidden(bool $hidden):void{
   public function setHidden(bool $hidden):void{
      $this->hidden = $hidden;
   }
   protected function setQuickEdit(bool $quickEdit):void{
   public function setQuickEdit(bool $quickEdit):void{
      $this->quickEdit = $quickEdit;
   }
   protected function setDefault(mixed $default):void
   public function setDefault(mixed $default):void
   {
      $this->default = $default;
   }
   protected function setQuill(bool $quill):void
   public function setQuill(bool $quill):void
   {
      $this->quill = $quill;
   }
@@ -126,7 +127,7 @@
      return $this->section??null;
   }
   protected function setMaxLength(int $maxLength):void
   public function setMaxLength(int $maxLength):void
   {
      $this->maxLength = $maxLength;
   }
@@ -163,4 +164,21 @@
   {
      return $this->subtype;
   }
   public function setCondition(array $condition):void
   {
      $required = ['field', 'operator', 'value'];
      foreach ($required as $field) {
         if (!array_key_exists($field, $condition)) {
            error_log('[Field]::setCondition Required condition '.$field.' not found');
            return;
         }
      }
      $this->condition = $condition;
   }
   public function getCondition(array $condition):array
   {
      return $this->condition;
   }
}