PHP Method Yii::getObjectVars Code Examples

This page contains top rated real world PHP examples of method Yii::getObjectVars extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: Presenter.php Project: frostealth/yii2-presenter
0
 /**
  * @inheritDoc
  */
 public function fields()
 {
     if ($this->entity instanceof Arrayable) {
         return $this->entity->fields();
     }
     $fields = is_array($this->entity) ? $this->entity : \Yii::getObjectVars($this->entity);
     $fields = array_keys($fields);
     $fields = array_combine($fields, $fields);
     return $fields;
 }
Example #2
Show file File: ResourceTrait.php Project: tuyakhov/yii2-json-api
0
 /**
  * @return array
  */
 public function fields()
 {
     $fields = array_keys(\Yii::getObjectVars($this));
     return array_combine($fields, $fields);
 }