Exemplo n.º 1
0
 /**
  *
  * Constructor. Data or format passed to Base model
  *
  * @param string $params
  * @param string $inputFormat
  * @param array $options
  */
 public function __construct($params = '', $inputFormat = 'application/json', $options = array())
 {
     parent::__construct($params, $inputFormat, $options);
 }
Exemplo n.º 2
0
 /**
  * Constructor. See base class for use of params
  * @see DrupalApi
  * @param string $params
  * @param array $expands
  * @param array $options
  *
  */
 public function __construct($params = '', $expands = array(), $options = array())
 {
     parent::__construct($params, $expands, $options);
     if (isset($params['nid'])) {
         $this->id = $params['nid'];
         $this->handle = 'node/' . $this->id;
         $this->link = '/hairdressing/api/item/' . $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}();
     }
     if (false) {
         // uncomment when you get a minute to unit test etc
         $bitstream = new Bitstream();
         $bitstream->setBundleName('URL_BUNDLE');
         $this->setBitstreams(array($bitstream));
     }
 }
Exemplo n.º 3
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();
     //}
 }
Exemplo n.º 4
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'];
     }
 }