/** * Get the item entry for a collection * * @return object */ public function item() { if (!$this->_item instanceof Item) { $item = new Tables\Item($this->_db); $item->loadType($this->get('id'), 'collection'); if (!$item->get('id')) { $item->type = 'collection'; $item->object_id = $this->get('id'); $item->title = $this->get('title'); $item->description = $this->get('description'); $item->access = $this->get('access', 0); if (!$item->check()) { $this->setError($item->getError()); } // Store new content if (!$item->store()) { $this->setError($item->getError()); } } $this->_item = new Item($item); } return $this->_item; }