AutorÃa | Ultima modificación | Ver Log |
<?phpdeclare(strict_types=1);namespace LeadersLinked\Mapper;use LeadersLinked\Mapper\Common\MapperCommon;use Laminas\Db\Adapter\AdapterInterface;use LeadersLinked\Model\Theme;class ThemeMapper extends MapperCommon{const _TABLE = 'tbl_themes';/**** @var ThemeMapper*/private static $_instance;/**** @param AdapterInterface $adapter*/private function __construct($adapter){parent::__construct($adapter);}/**** @param AdapterInterface $adapter* @return ThemeMapper*/public static function getInstance($adapter){if(self::$_instance == null) {self::$_instance = new ThemeMapper($adapter);}return self::$_instance;}/**** @param int $id* @return Theme*/public function fetchOne($id){$select = $this->sql->select(self::_TABLE);$select->where->equalTo('id', $id);$prototype = new Theme();return $this->executeFetchOneObject($select, $prototype);}/**** @param string uuid* @return Theme*/public function fetchOneByUuid($uuid){$select = $this->sql->select(self::_TABLE);$select->where->equalTo('uuid', $uuid);$prototype = new Theme();return $this->executeFetchOneObject($select, $prototype);}/**** @return Theme[]*/public function fetchAll(){$select = $this->sql->select(self::_TABLE);$prototype = new Theme();return $this->executeFetchAllObject($select, $prototype);}}