Loads single row data matched by composite primary key.

@param mixed $parentId
@param string $textMD5

@return array
497723
public function loadRow($parentId, $textMD5)
    {
        /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
        $query = $this->dbHandler->createSelectQuery();
        $query->select('*')->from(
            $this->dbHandler->quoteTable($this->table)
        )->where(
            $query->expr->lAnd(
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('parent'),
                    $query->bindValue($parentId, null, \PDO::PARAM_INT)
                ),
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('text_md5'),
                    $query->bindValue($textMD5, null, \PDO::PARAM_STR)
                )
            )
        );

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetch(\PDO::FETCH_ASSOC);
    }
419244
public static function findByParentModelId( $parentId, $parentType, $modelId ) {

		return self::queryByParentModelId( $parentId, $parentType, $modelId )->all();
	}
1014224
public function getChildren($parentID)
    {
        $tmp = [];
        foreach($this->categoryList as $key => $item){
            if($item->parentID == $parentID) {
                $tmp[] = $item;
            }
        }

        return $tmp;
    }
852239
public function loadAutogeneratedEntry($action, $parentId = null)
    {
        try {
            return $this->innerGateway->loadAutogeneratedEntry($action, $parentId);
        } catch (DBALException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        }
    }
1319861
public function getFollowersIdList( $parentId, $parentType ) {

        return self::findList( [  'column' => 'modelId', 'conditions' => [ 'type' => IFollower::TYPE_FOLLOW, 'active' => true, 'parentId' => $parentId, 'parentType' => $parentType ] ] );
    }
456887
private function getAllChildRoleIds($parentIds)
    {
        $allChildIds = [];

        while (count($parentIds) > 0) {
            $parentIds = $this->getChildIds($parentIds);
            $allChildIds = ArrayHelper::merge($allChildIds, $parentIds);
        };

        return $allChildIds;
    }
34177
public function loadChildrens($productIds, $storeId)
    {
        $children = [];

        foreach ($this->catalogProductType->getCompositeTypes() as $productTypeId) {
            $typeInstance = $this->getProductTypeInstance($productTypeId);
            $relation = $typeInstance->getRelationInfo();

            if ($relation->getTable() && $relation->getParentFieldName() && $relation->getChildFieldName()) {
                $select = $this->getRelationQuery($relation, $productIds, $storeId);
                $data   = $this->getConnection()->fetchAll($select);

                foreach ($data as $relationRow) {
                    $parentId = (int) $relationRow['parent_id'];
                    $childId  = (int) $relationRow['child_id'];
                    $sku      = (string) $relationRow['sku'];
                    $configurableAttributes = array_filter(explode(',', $relationRow["configurable_attributes"]));
                    $children[$childId][] = [
                        "parent_id"               => $parentId,
                        "configurable_attributes" => $configurableAttributes,
                        "sku"                     => $sku,
                    ];
                }
            }
        }

        return $children;
    }
1131694
public static function findByParentModelIdType( $parentId, $parentType, $modelId, $type ) {

		return self::queryByParentModelId( $parentId, $parentType, $modelId )->andWhere( 'type=:type', [ ':type' => $type ] )->all();
	}
1129473
static public function getIdParents($id = null)
    {
        $id = ($id) ? $id : self::getIdActiveMenu();
        
        $idParent = self::getMapIdParent();
        
        if (!is_array( $id ))
        {
            if (isset( $idParent[ $id ] ))
            {
                $id = array($id);
            }
            else
            {
                return array();
            }
        }
        
        if (isset( $idParent[ end( $id ) ] ))
        {
            if (isset($idParent[ $idParent[ end( $id ) ] ]))
            {
                $id[] = $idParent[ end( $id ) ];
                return self::getIdParents($id);
            }
        }        
        
        return array_reverse( $id );       
    }
761781
public function sortAlphabetically($parentId = false, $direction = SORT_ASC)
    {
        $query = call_user_func("$this->ownerClassName::find")
            ->select($this->primaryKey)
            ->orderBy([ $this->titleField => $direction ]);
        if ( $parentId !== false ) {
            $query->where([ $this->parentIdField => $parentId ]);
        }
        $data = array_map('intval', $query->column());
        foreach ( $data as $i => $id ) {
            call_user_func("$this->ownerClassName::updateAll",
                [ $this->sortField => ($i + 1) * 100 ],
                [ $this->primaryKey => $id ]);
        }
        $this->invalidateTagDependency();
    }
1312420
final protected function parseData(array $data, $parentId = 0)
    {
        $result = array();

        foreach ($data as $subArray) {
            $nested = array();

            if (isset($subArray[$this->childrenKey])) {
                // Recursive call
                $nested = $this->parseData($subArray[$this->childrenKey], $subArray[RelationBuilder::TREE_PARAM_ID]);
            }

            $result[] = array(
                RelationBuilder::TREE_PARAM_ID => $subArray[RelationBuilder::TREE_PARAM_ID], 
                RelationBuilder::TREE_PARAM_PARENT_ID => $parentId
            );

            $result = array_merge($result, $nested);
        }

        return $result;
    }
200478
public function findAll($parentId, array $query = [])
    {
        $resource = $this->createPartialResourceUrlForList($parentId);
        $data = $this->client->get($resource, $query);

        return $this->createMany(reset($data));
    }
738476
public static function findByParentId( $parentId, $config = [] ) {

		$limit 		= $config['limit'] ?? null;
		return self::find()->where( 'parentId=:id', [ ':id' => $parentId ] )->limit($limit)->all();
	}
1132590
public function __async_table($parentID)
    {
        $form = new Form($parentID);

        /** @var RelatedTabLocalized $tab */
        $tab = new RelatedTabLocalized($form);

        $content = $tab->getContent();

        return array('status' => 1, 'table' => $content);
    }
641820
public function getTermsTreeData($parentID = 0)
    {
        $tree = Hierarchy::getTree($this->id);

        $data = [];

        static::mapTreeDataRecursive($tree, $data, $parentID);

        return $data;
    }
287077
public static function getTree($vid, $parentID = false)
    {
        $rows = static::findHierarchy($vid, $parentID);
        $hierarchy = static::indexByChild($rows);

        /** @var Term [] $models */
        $models = Term::find()
            ->indexBy('id')
            ->where(['vid' => $vid])
            ->all();

        //add child to parents by list
        foreach ($hierarchy as $cID => $pID) {
            if (isset($models[$pID]) && isset($models[$cID])) {
                $models[$pID]->addChild($models[$cID]);
            }
        }

        $roots = [];

        foreach ($models as $id => $model) {
            if (isset($hierarchy[$id]) && $hierarchy[$id] == 0) {
                $roots[$id] = $model;
            }
        }

        return isset($models[$parentID]) ? $models[$parentID]->child : $roots;
    }
870235
public function getAllChildren($parentID)
    {
        $children = $this->getChildren($parentID);
        foreach ($children as $key => $child){
            $this->categoriesToBeDeleted[$child->categoryID] = $child;
            $this->getAllChildren($child->categoryID);
        }
    }