Ejemplo n.º 1
0
 /**
  * Constructor. See base class for use of params
  *
  * @see DrupalApi
  * @param string $params
  * @param array $expands
  */
 public function __construct($params = '', $expands = array())
 {
     parent::__construct($params, $expands);
     if (isset($params['nid'])) {
         $this->id = $params['nid'];
         $this->handle = 'node/' . $this->id;
         $this->link = '/hairdressing/api/community/' . $this->id;
     }
     if (isset($params['title'])) {
         $this->name = $params['title'];
     }
     if (isset($params['type'])) {
         $this->type = $params['type'];
     }
     if (isset($params['changed'])) {
         $this->lastModified = date('Y-m-d H:i:s\\.02', $params['changed']);
     }
     if (isset($params['expand'])) {
         $this->expand = $params['expand'];
     }
     //  "metadata", "collections", "parentCommunity", "subCommunities", "logo", "all"
     //foreach ($expands as $expand) {
     //  $method = "populate".ucfirst($expand);
     //  $this->$method();
     //}
 }
Ejemplo n.º 2
0
 /**
  * Constructor. See base class for use of params
  *
  * @see DrupalApi
  * @param string $params
  * @param array $expands
  */
 public function __construct($params = '', $expands = array())
 {
     parent::__construct($params, $expands);
     if (isset($params['nid'])) {
         $this->id = $params['nid'];
         $this->handle = 'node/' . $this->id;
         $this->link = '/hairdressing/api/community/' . $this->id;
         $this->populateCollections();
     }
     if (isset($params['title'])) {
         $this->name = $params['title'];
     }
     if (isset($params['type'])) {
         $this->type = $params['type'];
     }
     if (isset($params['changed'])) {
         $this->lastModified = date('Y-m-d H:i:s\\.02', $params['changed']);
     }
     if (isset($params['expand'])) {
         $this->expand = $params['expand'];
     }
 }