/** * Ensures the existing item is instantiated and valid. */ protected function assertItem() { if (isset($this->item)) { return true; } if (!isset($this->item_id)) { throw new vB_Exception_DM('No item id specified for creating an existing item in ' . get_class($this)); } $this->item = new $this->item_class($this->item_id); if (!$this->item->isValid()) { throw new vB_Exception_DM('The existing item assigned to the DM is not valid (class: ' . $this->item_class . ' id: ' . print_r($this->item_id, 1) . ')'); } }