/**
  * Get the instance as an array.
  *
  * @return array
  */
 public function toArray()
 {
     $return = get_object_public_vars($this);
     foreach ($return as $key => $value) {
         if (is_null($value)) {
             unset($return[$key]);
         }
     }
     return $return;
 }
Example #2
0
File: crud.php Project: wushian/MDD
 /**
  * Returns all of $this object's public properties as an associative array.
  *
  * @return  array
  */
 public function to_array()
 {
     return get_object_public_vars($this);
 }
Example #3
0
 private function _getNonNullProps()
 {
     foreach (get_object_public_vars($this) as $key => $value) {
         if ($value !== null) {
             $nonnull[$key] = $value;
         }
     }
     return isset($nonnull) ? $nonnull : [];
 }
Example #4
0
 /**
  * Get all the attributes of the model.
  *
  * @return array
  */
 public function attributes()
 {
     $attributes = get_object_public_vars($this);
     unset($attributes['children']);
     unset($attributes['parent']);
     return $attributes;
 }
 /**
  * Returns the column names of the model that have been set for current
  * object.
  *
  * The column names are determined from public object vars.
  *
  * @return array
  */
 public function getSetColumnNames()
 {
     return array_keys(get_object_public_vars($this));
 }
 /**
  * Get the instance as an array.
  *
  * @return array
  */
 public function toArray()
 {
     $return = get_object_public_vars($this);
     return $return;
 }