Exemplo n.º 1
0
 public function toArray()
 {
     # Cause property table have MongoID object
     $data = parent::toArray();
     $data['table'] = $this->getTableArray();
     return $data;
 }
Exemplo n.º 2
0
 /**
  * Perform a patch request
  *
  * @param array $properties The new properties of the person
  *
  * @return Node
  */
 public function patch($properties)
 {
     // Apply the new data properties we expect
     // a flat document with lastName, firstName, roles, ...
     $fullModel = $this->getValues();
     foreach ($properties as $key => $value) {
         $fullModel[$key] = $value;
     }
     unset($fullModel['_method']);
     unset($fullModel['id']);
     unset($fullModel['identifier']);
     // Invoke the update method
     return parent::update($fullModel);
 }