Scalr\Model\Entity\Image::getPlatforms PHP Метод

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

Get array of image's platforms
public static getPlatforms ( integer $accountId, integer $envId ) : array
$accountId integer
$envId integer
Результат array Array of platform's names
    public static function getPlatforms($accountId, $envId)
    {
        $sql = "SELECT DISTINCT `platform` FROM `images` WHERE account_id = ?";
        $args[] = $accountId;
        if ($envId) {
            $sql .= " AND env_id = ?";
            $args[] = $envId;
        }
        return \Scalr::getDb()->GetCol($sql, $args);
    }

Usage Example

Пример #1
0
 public function viewAction()
 {
     $this->restrictAccess('IMAGES');
     $this->response->page('ui/images/view.js', ['platforms' => Image::getPlatforms($this->user->getAccountId() ?: null, $this->getEnvironmentId(true))]);
 }