Scalr\Model\Entity\Role::getImages PHP Méthode

getImages() public méthode

Gets Images which are associated with the Role
public getImages ( array $criteria = null, array $group = null, array $order = null, integer $limit = null, integer $offset = null, boolean $countRecords = null ) : EntityIterator
$criteria array optional The search criteria on the Image result set.
$group array optional The group parameter
$order array optional The results order looks like [[property1 => true|false], ...]
$limit integer optional The records limit
$offset integer optional The offset
$countRecords boolean optional True to calculate total number of the records without limit
Résultat Scalr\Model\Collections\EntityIterator Returns Images which are associated with the role
    public function getImages(array $criteria = null, array $group = null, array $order = null, $limit = null, $offset = null, $countRecords = null)
    {
        $image = new Image();
        $roleImage = new RoleImage();
        $criteria = $criteria ?: [];
        $criteria[static::STMT_FROM] = $image->table() . "\n            JOIN " . $roleImage->table() . " ON {$roleImage->columnImageId} = {$image->columnId}\n                AND {$roleImage->columnPlatform} = {$image->columnPlatform}\n                AND {$roleImage->columnCloudLocation} = {$image->columnCloudLocation}";
        $criteria[static::STMT_WHERE] = "{$roleImage->columnRoleId} = " . intval($this->id);
        $criteria[] = ['$or' => [['accountId' => null], ['$and' => [['accountId' => $this->accountId], ['$or' => [['envId' => null], ['envId' => $this->envId]]]]]]];
        return $image->find($criteria, $group, $order, $limit, $offset, $countRecords);
    }