AutorÃa | Ultima modificación | Ver Log |
<?phpdeclare(strict_types=1);namespace LeadersLinked\Mapper;use Laminas\Db\Adapter\AdapterInterface;use LeadersLinked\Model\Service;use LeadersLinked\Mapper\Common\MapperCommon;class ServiceMapper extends MapperCommon{const _TABLE = 'tbl_services';/**** @var ServiceMapper*/private static $_instance;/**** @param AdapterInterface $adapter*/private function __construct($adapter){parent::__construct($adapter);}/**** @param AdapterInterface $adapter* @return ServiceMapper*/public static function getInstance($adapter){if(self::$_instance == null) {self::$_instance = new ServiceMapper($adapter);}return self::$_instance;}/**** @return Service[]*/public function fetchAll(){$prototype = new Service();$select = $this->sql->select(self::_TABLE);$select->order('name ASC');return $this->executeFetchAllObject($select, $prototype);}}