/** * Returns the current container row * * @return ComFilesModelEntityContainer * @throws UnexpectedValueException */ public function getContainer() { if (!isset(self::$_container)) { //Set the container $container = $this->getObject('com:files.model.containers')->slug($this->getState()->container)->fetch(); if (!is_object($container) || !count($container) || $container->isNew()) { throw new UnexpectedValueException('Invalid container: ' . $this->getState()->container); } self::$_container = $container->top(); } return self::$_container; }