Gets number of child bookmarks in a specfied parent bookmark.

@param integer $parent

@return integer
@throws Exception
12363
public function getChildBookmarksCount($parent)
    {

        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/bookmarks/' . $parent . '/bookmarks';
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $json = json_decode($responseStream);
        return count($json->Bookmarks->List);
    }
303836
private static function getStringElement(\DOMElement $parent, string $name) : ?string
    {
        $e = self::getStringElements($parent, $name);
        if (empty($e)) {
            return null;
        }
        if (count($e) > 1) {
            throw new \Exception('More than one '.$name.' in '.$parent->tagName);
        }

        return $e[0];
    }
633745
public function getNestedFolderCount( $pattern = NULL )
	{
		$count	= 0;
		foreach( $this->getNestedFolderList( $pattern ) as $entry )
			$count++;
		return $count;
	}
614483
private function establishBaseParametersFromParent($parent)
	{
		$this->set('parent_id', $parent->id);
		$this->set('level', $parent->level + 1);

		return $this->applyScopes($parent);
	}
861649
public function getCountByParent( $parentId, $parentType ) {

		$modelClass	= static::$modelClass;

		return $modelClass::queryByParent( $parentId, $parentType )->count();
	}
150393
public function getSegmentCount($pageNumber = '', $fragmentNumber = '')
    {


        if ($pageNumber == '')
            throw new Exception('page number not specified');

        if ($fragmentNumber == '')
            throw new Exception('fragment number not specified');


        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/pages/' . $pageNumber . '/fragments/' . $fragmentNumber;

        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($responseStream);

        return count($json->TextItems->List);
    }
999123
static function fetchChildCountByVersionStatus( $parentNodeIDList, $status = eZContentObjectVersion::STATUS_PENDING )
    {
        $db = eZDB::instance();
        $parentIDStatement = $db->generateSQLINStatement( $parentNodeIDList );
        $sql = "SELECT COUNT( DISTINCT eznode_assignment.id ) AS cnt
                    FROM ezcontentobject_version, eznode_assignment
                    WHERE ezcontentobject_version.contentobject_id = eznode_assignment.contentobject_id
                    AND ezcontentobject_version.version = eznode_assignment.contentobject_version
                    AND ezcontentobject_version.status = $status
                    AND eznode_assignment.parent_node $parentIDStatement ";
         $countResult = $db->arrayQuery( $sql );
         return (int)$countResult[0]['cnt'];
    }
730257
public function getOnlineChildren(Node $parent, $lang = null)
    {
        return $this->getOnlineChildrenQueryBuilder($parent, $lang)
            ->getQuery()->getResult();
    }
154887
public function setChild($parent, $child)
    {
        if (is_string($parent)) {
            $name   = $parent;
            $parent = $this->getItem($parent);
            if (is_null($parent)) {
                throw new Exception("Unknown parent:$name at setChild");
            }
        }
        if (is_string($child)) {
            $name  = $child;
            $child = $this->getItem($child);
            if (is_null($child)) {
                throw new Exception("Unknown child:$name at setChild");
            }
        }
        if (isset($this->children[$parent->name][$child->name])) {
            return false;
        }

        return $this->addChild($parent, $child);
    }
38954
public function isChildBookmark($bookmarkIndex)
    {

        if ($bookmarkIndex === '')
            throw new Exception('bookmark index not specified');
        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/bookmarks/' . $bookmarkIndex;
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $json = json_decode($responseStream);
        return $json->Bookmark;
    }
1316480
public function getRelationExistenceCountQuery(Builder $query, Builder $parentQuery)
    {
        return $this->getRelationExistenceQuery(
            $query, $parentQuery, new Expression('count(*)')
        );
    }
1033807
public function getCount()
	{
		if ( $this->empty ) return 0;

		if ( $this->src->getIsFinished() )
		{
			return count( $this->buffer );
		}
		return parent::getCount();
	}
240343
public function getNumOfParent($id)
    {
        if ($parents = $this->qb
            ->table($this->table)
            ->select('id')
            ->where('id', $id)
            ->get()) {
            return $parents->count();
        }

        return 0;
    }
863853
public function getRelationCountQuery(Builder $query, Builder $parent)
	{
		if ($parent->getQuery()->from == $query->getQuery()->from)
		{
			return $this->getRelationCountQueryForSelfRelation($query, $parent);
		}

		$query->select(new Expression('count(*)'));

		$otherKey = $this->wrap($query->getModel()->getTable().'.'.$this->otherKey);

		return $query->where($this->getQualifiedForeignKey(), '=', new Expression($otherKey));
	}
251731
public function childCount(EntityInterface $node, $direct = false)
    {
        $config = $this->getConfig();
        $parent = $this->_table->aliasField($config['parent']);

        if ($direct) {
            return $this->_scope($this->_table->find())
                ->where([$parent => $node->get($this->_getPrimaryKey())])
                ->count();
        }

        $this->_ensureFields($node);

        return ($node->get($config['right']) - $node->get($config['left']) - 1) / 2;
    }
213605
public function getFromParentPage($dbField)
    {
        if (!is_string($dbField)) {
            throw new Exception('You can only give strings to getFromParentPage');
        }

        $result = null;

        // if this isn't the top level page...
        $parentPage = $this->owner->Parent();
        if ($parentPage) {
            // ... check if it has this field...
            if ($parentPage->hasField($dbField)) {
                $result = $parentPage->$dbField;
            } else if (get_class($parentPage) != 'SiteTree') {
                // ... if not call its parent.
                $result = $parentPage->getFromParentPage($dbField);
            }
        }

        return $result;
    }
1326257
public function getRelationCountQuery(Builder $query, Builder $parent)
    {
        return $this->getRelationExistenceQuery($query, $parent, new Expression('count(*)'));
    }