public function getBranchChildrenCount($pk = null, $scope = null, $filter = null)
{
$condition = $this->getCondition();
$storageController = $this->objects->getStorageController($this->getObject());
if ($pk) {
$pk = $storageController->normalizePrimaryKey($pk);
}
if ($limit = $this->getObjectDefinition()->getLimitDataSets()) {
$condition->mergeAnd($limit);
}
if ($this->getPermissionCheck() && ($aclCondition = $this->acl->getListingCondition($this->getObject()))) {
$condition->mergeAndBegin($aclCondition);
}
if ($filter) {
$filterCondition = self::buildFilter($filter);
$condition->mergeAnd($filterCondition);
}
if ($extraCondition = $this->getCustomListingCondition()) {
$condition->mergeAnd($extraCondition);
}
return $storageController->getBranchChildrenCount($pk, $condition, $scope);
}