Find heading element (h1, h2, h3)

@param integer $level     heading level 1 for h1, 2 for h2, ...
@param string  $id        element identifier
@param array   $relations tag relations (near, in, under)

@return Accessor\HeadingAccessor
19848
public function findHeader($level = 1, $id = null, array $relations = array())
    {
        return new Accessor\HeadingAccessor($level, $id, $relations, $this->con);
    }
633784
public static function find($id, $columns = array('*')) {
        $debug = debug_backtrace(false);

        if (static::$throwOnFind && $debug[1]['function'] != 'findOrFail') {
            return self::findOrFail($id, $columns);
        } else {
            return parent::find($id, $columns);
        }
    }
1300868
public function findListItem($id = null, array $relations = array())
    {
        return new Accessor\ListItemAccessor($id, $relations, $this->con);
    }
233277
public function getChildrenDsIds($dsId, $level = 1)
    {
        $childrenDsIds = (array_key_exists($dsId, $this->childrenMap))
            ? $this->childrenMap[$dsId]
            : [];

        if (($level > 1) && count($childrenDsIds)) {
            $subChildDsIds = [$childrenDsIds];

            foreach ($childrenDsIds as $childDsId) {
                $subChildDsIds[] = $this->getChildrenDsIds($childDsId, $level - 1);
            }

            $childrenDsIds = call_user_func_array('array_merge', $subChildDsIds);
        }

        return $childrenDsIds;
    }
600648
protected function _find($id, $options = [])
    {
        $defaults = [
            'query'        => [],
            'fetchOptions' => []
        ];
        $options += $defaults;

        $fetchOptions = $options['fetchOptions'];
        unset($options['fetchOptions']);

        if ($this->link() !== static::LINK_KEY) {
            throw new ORMException("This relation is not based on a foreign key.");
        }
        $to = $this->to();
        $schema = $to::definition();

        if (!$id) {
            return $to::create([], ['type' => 'set']);
        }

        $ids = is_array($id) ? $id : [$id];
        $key = $schema->key();
        $column = $schema->column($key);

        foreach ($ids as $i => $value) {
            $ids[$i] = $schema->convert('cast', $column['type'], $value, $column);
        }

        if (count($ids) === 1) {
            $ids = reset($ids);
        }
        $conditions = [$this->keys('to') => $ids];
        if ($this->conditions()) {
            $conditions = [
                ':and()' => [
                    [$this->keys('to') => $ids],
                    $this->conditions()
                ]
            ];
        }
        $query = Set::extend($options['query'], ['conditions' => $conditions]);
        return $to::all($query, $fetchOptions);
    }
227654
public function findTrashed($id, $related = [])
    {
        return $this->model->onlyTrashed()->with($related)->find($id);
    }
979723
public function findAssociationPerformancelevelByID($id)
    {
        $performancelevels = $this->findAssociationPerformancelevels()->getPerformancelevels();

        $performancelevels->rewind();

        while ($performancelevels->valid()) {
            $performancelevel = $performancelevels->current();
            if ($performancelevel->getID() == $id) {
                return $performancelevel;
            }

            $performancelevels->next();
        }
    }
199288
public static function find( $table, $id, $key = null, $handler = null ) 
	{
		return Query::select( $table )->find( $id, $key, $handler );
	}
971645
public function detach($id, $relation, $attributes)
    {
        return $this->find($id)->{$relation}()->detach($attributes);
    }
1343518
public function findSpan($id = null, array $relations = array())
    {
        return new Accessor\SpanAccessor($id, $relations, $this->con);
    }
620897
public function getParents ($relationIdentifier, $id, $inputQuery = null)
		{
			return $this->getChildren($relationIdentifier, $id, $inputQuery);
		}
670096
public function findMany($ids, $columns = ['*'])
    {
        return empty($ids) ? [] : $this->whereIn(
            $this->getRelated()->getQualifiedKeyName(), $ids
        )->get($columns);
    }
231817
protected function _findInChildren(array $element, $id, $withParents, array &$parents)
    {
        if ($element['id'] == $id) {
            return $element;
        }
        foreach ($element['children'] as $child) {
            if ($child['id'] == $id) {
                if ($withParents) {
                    $parents[] = $element;
                }
                return $child;
            }
            if (null !== ($found = $this->_findInChildren($child, $id, $withParents, $parents))) {
                if ($withParents) {
                    $parents[] = $element;
                }
                return $found;
            }
        }
    }
844203
public function findParentNodesByChildId($id)
	{
        // To be returned
        $result = array();

        $rl = $this->getRelations();
        $data = $rl[RelationBuilder::TREE_PARAM_ITEMS];

        // If can't find, then return empty array
        if (!isset($data[$id])) {
            return array();
        }

        $current = $data[$id];
        $parentId = $current[RelationBuilder::TREE_PARAM_PARENT_ID];

        while (isset($data[$parentId])) {
            $current = $data[$parentId];
            $parentId = $current[RelationBuilder::TREE_PARAM_PARENT_ID];

            array_push($result, $current);
        }

        return $result;
    }
463225
protected function hasParent($id, array $relationships)
    {
        foreach ($relationships as $parentId => $children) {
            // 0 is reserved, therefore must be ignored
            if ($parentId == 0) {
                continue;
            }

            if (in_array($id, $children)) {
                return true;
            }
        }

        // By default
        return false;
    }
330693
public function findChild($id)
    {
        foreach ($this->getChildren() as $child) {
            $result = $this->findChildInNode($child, $id);

            if ($result) {
                return $result;
            }
        }

        return null;
    }
909406
public function findImage($id = null, array $relations = array())
    {
        return new Accessor\ImageAccessor($id, $relations, $this->con);
    }