Imbo\EventListener\ImageVariations\Database\Mongo::getBestMatch PHP Метод

getBestMatch() публичный Метод

public getBestMatch ( $user, $imageIdentifier, $width )
    public function getBestMatch($user, $imageIdentifier, $width)
    {
        $query = ['user' => $user, 'imageIdentifier' => $imageIdentifier, 'width' => ['$gte' => $width]];
        $result = $this->getCollection()->findOne($query, ['projection' => ['_id' => false, 'width' => true, 'height' => true], 'sort' => ['width' => 1]]);
        return $result ? $result->getArrayCopy() : null;
    }