Pimcore\Model\Asset\Dao::getChildAmount PHP Метод

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

returns the amount of directly childs (not recursivly)
public getChildAmount ( User $user = null ) : integer
$user User
Результат integer
    public function getChildAmount($user = null)
    {
        if ($user and !$user->isAdmin()) {
            $userIds = $user->getRoles();
            $userIds[] = $user->getId();
            $query = "select count(*) from assets a where parentId = ?\n                            and (select list as locate from users_workspaces_asset where userId in (" . implode(',', $userIds) . ") and LOCATE(cpath,CONCAT(a.path,a.filename))=1  ORDER BY LENGTH(cpath) DESC LIMIT 1)=1;";
        } else {
            $query = "SELECT COUNT(*) AS count FROM assets WHERE parentId = ?";
        }
        $c = $this->db->fetchOne($query, $this->model->getId());
        return $c;
    }