Пример #1
0
 /**
  * {@inheritdoc}
  *
  * @param   mixed $data          Table data
  * @param   bool  $loadExtraData Load Extra data flag
  * @param   bool  $loadParent    Load parent flag
  */
 public function __construct($data, $loadExtraData = true, $loadParent = false)
 {
     parent::__construct($data);
     $data = (array) $data;
     // Make sure the name of the table is properly formatted.
     $this->tableName = NenoHelper::unifyTableName($this->tableName);
     $this->primaryKey = is_array($this->primaryKey) ? json_encode($this->primaryKey) : json_decode($this->primaryKey);
     if (!empty($data['groupId']) && $loadParent) {
         $this->group = NenoContentElementGroup::load($data['groupId'], $loadExtraData);
     }
     // Init the field list
     $this->fields = null;
     if (!$this->isNew()) {
         $this->getFields($loadExtraData);
         if ($loadExtraData) {
             $this->getWordCount();
             $this->getRecordCount();
         }
     }
 }