示例#1
0
 /**
  * @param podBuilder PodPool;
  * @return Pod;
  */
 public function __construct(&$anise, &$schemaDef, &$schema)
 {
     parent::__construct($schemaDef['name']);
     $this->fields = array();
     foreach ($schemaDef['fields'] as $schemaField) {
         if ($schemaField['is-list']) {
             $field = new ListFieldPod($anise, $schemaField, $schema);
         } else {
             if ($schemaField['is-set']) {
                 $field = new SetFieldPod($anise, $schemaField, $schema);
             } else {
                 $field = new FieldPod($anise, $schemaField, $schema);
             }
         }
         $this->fields[$field->st_name] = $field;
     }
     $this->st_name = $schemaDef['name'];
     $this->st_display_name = $schemaDef['display-name'];
     $this->st_description = $schemaDef['description'];
     $this->labels = $schemaDef['labels'];
     $this->custom_post_type_params = isset($schemaDef['custom_post_type_params']) ? $schemaDef['custom_post_type_params'] : array();
     $this->f_struct = $schemaDef['is-struct'];
     $this->st_title_template = $schemaDef['title'];
     $this->rg_index_columns = $schemaDef['index-columns'];
 }
示例#2
0
文件: fieldpod.php 项目: encse/anise
 /**
  * @param schmea array;
  */
 function __construct(&$anise, &$schemaField, &$schema)
 {
     parent::__construct($schemaField['name']);
     $this->anise = $anise;
     $this->fRequired = $schemaField['required'];
     $this->st_display_name = $schemaField['display-name'];
     $this->st_description = $schemaField['description'];
     $this->type = $schemaField['type'];
     $schemaType = $schema[$this->type];
     if ($schemaType && !$schemaType['is-struct']) {
         $this->podImpl = new ReferencePod($schemaType);
     }
 }
示例#3
0
 function __construct(&$schemaDef)
 {
     parent::__construct('ref_to_' . $schemaDef['name']);
     $this->type = $schemaDef['name'];
 }