コード例 #1
0
ファイル: Bitstream.php プロジェクト: pdiveris/api_ht
 /**
  *
  * 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);
 }
コード例 #2
0
ファイル: Item.php プロジェクト: pdiveris/api_ht
 /**
  * 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));
     }
 }
コード例 #3
0
ファイル: Collection.php プロジェクト: pdiveris/api_ht
 /**
  * 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();
     //}
 }
コード例 #4
0
ファイル: Community.php プロジェクト: pdiveris/api_ht
 /**
  * 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'];
     }
 }