Retrieves a child with given position.

@param $position
@param array $columns
@return Entity
174981
public function getChildAt($position, array $columns = ['*'])
    {
        if ($this->hasChildrenRelation()) {
            $result = $this->getRelation($this->getChildrenRelationIndex())->get($position);
        } else {
            $result = $this->children($position)->first($columns);
        }

        return $result;
    }
830852
public function get($columns = ['*'])
    {
        $result = $this->getBuilder()->get($columns);

        // Reset query builder
        $this->resetBuilder();

        return $result;
    }
967176
protected function getPosition($id)
    {
        $cols = [
            self::COLUMN_LEFT,
            self::COLUMN_RIGHT,
            'width' => new Expression(self::COLUMN_RIGHT . ' - ' . self::COLUMN_LEFT . ' + 1'),
        ];

        $select = $this->getSelect();

        $where = new Where;
        $where->equalTo($this->getPrimaryKey(), $id);
        $select->columns($cols)->where($where);

        $row = $this->fetchResult($select)->current();

        return $row;
    }
1191906
public function get($columns = ['*'])
    {
        $columns = $this->query->getQuery()->columns ? [] : $columns;

        if ($columns === ['*']) {
            $columns = [$this->related->getTable().'.*'];
        }

        $columns[] = $this->getQualifiedFirstLocalKeyName().' as '.static::THROUGH_KEY;

        $this->query->addSelect($columns);

        return $this->query->get();
    }
42787
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getName();
                break;
            case 2:
                return $this->getRole();
                break;
            default:
                return null;
                break;
        } // switch()
    }
291843
public function getPositionAfter(TablePosition $position, $offset = 1)
    {
        $cellsToMove = $offset;
        $newRow = $position->getRow();
        $newCell = $position->getCell();

        while ($cellsToMove > 0 && $newRow < count($this->rows)) {
            $cellCount = count($this->getRow($newRow)->getCells());

            $cellsLeft = $cellCount - $newCell - 1;

            if ($cellsToMove > $cellsLeft) {
                ++$newRow;
                $cellsToMove -= $cellsLeft - 1;
                $newCell = 0;
            } else {
                $newCell = $newCell + $cellsToMove;
                $cellsToMove -= $cellsLeft;
            }
        }

        if ($newRow >= 0 && $newCell >= 0) {
            return new TablePosition($newRow, $newCell);
        }

        return;
    }
674771
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getPersonId();
                break;
            case 2:
                return $this->getTeamId();
                break;
            case 3:
                return $this->getCreatedAt();
                break;
            case 4:
                return $this->getUpdatedAt();
                break;
            case 5:
                return $this->getVersion();
                break;
            case 6:
                return $this->getVersionCreatedAt();
                break;
            case 7:
                return $this->getVersionCreatedBy();
                break;
            case 8:
                return $this->getPersonIdVersion();
                break;
            case 9:
                return $this->getTeamIdVersion();
                break;
            default:
                return null;
                break;
        } // switch()
    }
281651
public function getNodeAt($position) {
        if (0 <= $position && $position <= count($this->nodes) - 1) {
            return $this->nodes[$position];
        }
        return null;
    }
635579
public function getByPosition($position)
    {
        $position = (int) $position;

        if (!isset($this->parametersByPosition[$position])) {
            throw new \Exception('Parameter is not defined !');
        }

        return $this->parametersByPosition[$position];
    }
64634
public function get($columns = ['*'])
    {
        $original = $this->columns;

        if (is_null($original)) {
            $this->columns = $columns;
        }

        $results = $this->processor->processSelect($this, $this->runSelect());

        $this->columns = $original;

        return collect($results);
    }
1015124
public function eq($position)
    {
        if (isset($this->nodes[$position])) {
            return $this->createSubCrawler($this->nodes[$position]);
        }

        return $this->createSubCrawler(null);
    }
297277
public function rowNumColumns($position = null)
    {
        if ($position === null) {
            $position = $this->position();
        }

        $row = $this->rowData($position);
        if ($row === null) {
            return null;
        } else {
            return array_sum($row['columns']);
        }
    }
340125
public function findOrFail($id, $columns = ['*'])
    {
        if (!is_null($entity = $this->find($id, $columns))) {
            return $entity;
        }

        throw (new EntityNotFoundException())->setEntity(get_class($this->entityMap));
    }
270760
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getCreatedAt();
                break;
            case 2:
                return $this->getUpdatedAt();
                break;
            default:
                return null;
                break;
        } // switch()
    }
565714
public function getPositionBefore(TablePosition $position, $offset = 1)
    {
        if ($position->getCell() > ($offset - 1)) {
            $newRow = $position->getRow();
            $newCell = $position->getCell() - $offset;
        } elseif ($position->getRow() > 0) {
            $cellsToMove = $offset;
            $newRow = $position->getRow();
            $newCell = $position->getCell();

            while ($cellsToMove > 0 && $newRow >= 0) {
                if ($cellsToMove > $newCell) {
                    --$newRow;
                    if ($newRow < 0) {
                        return;
                    }

                    $cellsToMove = $cellsToMove - ($newCell + 1);
                    $cellCount = count($this->getRow($newRow)->getCells());
                    $newCell = $cellCount - 1;
                } else {
                    $newCell = $newCell - $cellsToMove;
                    $cellsToMove -= $newCell;
                }
            }
        } else {
            return;
        }

        if ($newRow >= 0 && $newCell >= 0) {
            return new TablePosition($newRow, $newCell);
        }

        return;
    }
1279545
public function getField($position)
    {
        if (!isset($this->fields[$position])) {
            switch ($position) {
                case 0:
                    $this->fields[$position] = new SecondsField();
                    break;
                case 1:
                    $this->fields[$position] = new MinutesField();
                    break;
                case 2:
                    $this->fields[$position] = new HoursField();
                    break;
                case 3:
                    $this->fields[$position] = new DayOfMonthField();
                    break;
                case 4:
                    $this->fields[$position] = new MonthField();
                    break;
                case 5:
                    $this->fields[$position] = new DayOfWeekField();
                    break;
                default:
                    throw new InvalidArgumentException(
                        $position . ' is not a valid position'
                    );
            }
        }
        return $this->fields[$position];
    }
741502
public static function findByPosition($position)
    {
        try {
            $offset = $position - 1;
            $tableName = self::getTableName();
            $conn = self::getConnection();

            $stmt = $conn->query('SELECT * FROM '.$tableName.' LIMIT '.$offset.', 1'); //mysql syntax
            if(! $stmt) {
                $stmt = $conn->query('SELECT * FROM '.$tableName.' OFFSET '.$offset.' LIMIT 1'); //pgsql syntax
            }

            return self::find($stmt);;
        }
        catch(PDOException $pe) {
            return $pe->getMessage();
        }
        catch(Exception $e) {
            return $e->getMessage();
        }
    }