Ansel_Faces_Base::_fetchFaces PHP Метод

_fetchFaces() защищенный Метод

Fetchs all faces from all galleries the current user has READ access to
protected _fetchFaces ( array $info, integer $from, integer $count ) : mixed
$info array Array of select criteria
$from integer Offset
$count integer Limit
Результат mixed An array of face hashes containing face_id, gallery_id, image_id, face_name.
    protected function _fetchFaces(array $info, $from = 0, $count = 0)
    {
        $galleries = $GLOBALS['injector']->getInstance('Ansel_Storage')->listGalleries(array('perm' => Horde_Perms::READ));
        $ids = array();
        foreach ($galleries as $gallery) {
            $ids[] = $gallery->id;
        }
        $sql = 'SELECT f.face_id, f.gallery_id, f.image_id, f.face_name FROM ' . 'ansel_faces f WHERE f.gallery_id IN (' . implode(',', $ids) . ') ORDER BY ' . (isset($info['order']) ? $info['order'] : ' f.face_id DESC');
        $sql = $GLOBALS['ansel_db']->addLimitOffset($sql, array('offset' => $from, 'limit' => $count));
        try {
            return $GLOBALS['ansel_db']->selectAll($sql);
        } catch (Horde_Db_Exception $e) {
            throw new Ansel_Exception($e);
        }
    }