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

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

Returns the amount of children (not recursively),
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 documents d where parentId = ?\n                    and (select list as locate from users_workspaces_document where userId in (" . implode(',', $userIds) . ") and LOCATE(cpath,CONCAT(d.path,d.`key`))=1  ORDER BY LENGTH(cpath) DESC LIMIT 1)=1;";
        } else {
            $query = "SELECT COUNT(*) AS count FROM documents WHERE parentId = ?";
        }
        $c = $this->db->fetchOne($query, $this->model->getId());
        return $c;
    }