/** * Return the user that owns this entity * * @return \Idno\Entities\User */ function getOwner() { if (!empty($this->owner)) { return \Idno\Core\db()->getObject($this->owner); } return false; }
/** * Delete this entity * @todo complete this * @return bool */ function delete() { $event = new \Idno\Core\Event(array('object' => $this)); $event->setResponse(true); if (\Idno\Core\site()->triggerEvent('delete', array('object' => $this))) { $this->unsyndicate(); if ($entries = \Idno\Entities\ActivityStreamPost::getByObjectUUID($this->getUUID())) { foreach ($entries as $entry) { $entry->delete(); } } if ($return = \Idno\Core\db()->deleteRecord($this->getID())) { $this->deleteData(); return $return; } } return false; }