Frontend\Modules\Location\Engine\Model::getAll PHP Метод

getAll() публичный статический Метод

Get all items
public static getAll ( ) : array
Результат array
    public static function getAll()
    {
        return (array) FrontendModel::getContainer()->get('database')->getRecords('SELECT * FROM location WHERE language = ? AND show_overview = ?', array(LANGUAGE, 'Y'));
    }

Usage Example

Пример #1
0
 /**
  * Load the data
  */
 protected function loadData()
 {
     $this->items = FrontendLocationModel::getAll();
     $this->settings = FrontendLocationModel::getMapSettings(0);
     $firstMarker = current($this->items);
     if (empty($this->settings)) {
         $this->settings = $this->get('fork.settings')->getForModule('Location');
         $this->settings['center']['lat'] = $firstMarker['lat'];
         $this->settings['center']['lng'] = $firstMarker['lng'];
     }
     // no center point given yet, use the first occurrence
     if (!isset($this->settings['center'])) {
         $this->settings['center']['lat'] = $firstMarker['lat'];
         $this->settings['center']['lng'] = $firstMarker['lng'];
     }
 }