コード例 #1
0
 protected function getSerializableProperties()
 {
     $properties = parent::getSerializableProperties();
     // We remove nested objects as we can't update it
     unset($properties['article']);
     unset($properties['user']);
     return $properties;
 }
コード例 #2
0
 /**
  * Associate $object to current model instance.
  *
  * @param \NwWebsite\Models\Model $object
  */
 public function associate(Model $object)
 {
     $resourcePath = $this->getResourcePath() . $object->getResourcePath();
     $di = Di::getInstance();
     $di->api->createResource($resourcePath, null);
 }