public function __construct($itemTypeOrID=false) { parent::__construct(); if ($itemTypeOrID) { $this->setField("itemTypeID", Zotero_ItemTypes::getID($itemTypeOrID)); } }
public function __get($field) { $val = parent::__get($field); if (!is_null($val)) { return $val; } if (isset($this->{'_' . $field})) { return $this->{'_' . $field}; } if (($this->_id || $this->_key) && !$this->loaded) { $this->load(true); } switch ($field) { case 'parent': return $this->getParent(); case 'parentKey': return $this->getParentKey(); case 'etag': return $this->getETag(); } if (!property_exists('Zotero_Collection', '_' . $field)) { throw new Exception("Zotero_Collection property '{$field}' doesn't exist"); } $field = '_' . $field; return $this->{$field}; }
public function __get($field) { switch ($field) { case 'etag': return $this->getETag(); default: return parent::__get($field); } }