IgorKorytin

Untitled

Sep 4th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1.     public static function all()
  2.     {
  3.         $connection = Yii::app()->db;
  4.         $sql = 'SELECT * FROM `services` ORDER BY name ASC';
  5.         $models = $connection->createCommand($sql)->queryAll();
  6.         $return = [];
  7.         foreach ($models as $id => $name) {
  8.             $return[$id] = $name;
  9.             var_dump($return);
  10.         }
  11.  
  12.         return $return;
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment