Prepends the given entities to the list.

@param SortableEntityInterface[] $prepended
@param array                     $where
4691
public function prependEntities (array $prepended, array $where = []) : void
    {
        $all = $this->getAllEntities($where);
        $index = 0;

        // first prepend
        foreach ($prepended as $prependedEntity)
        {
            $prependedEntity->setSortOrder($index);
            ++$index;
        }

        // then sort the rest
        foreach ($all as $entity)
        {
            if (\in_array($entity, $prepended, true))
            {
                continue;
            }

            $entity->setSortOrder($index);
            ++$index;
        }
    }
111714
public function prepend(string $name, $prependValue)
    {
        if (! is_array($prependValue)) {
            $prependValue = [$prependValue];
        }

        if (! $this->has($name)) {
            $this->put($name, $prependValue);

            return $this;
        }

        $oldValue = $this->get($name);

        if (! is_array($oldValue)) {
            $oldValue = [$oldValue];
        }

        $newValue = array_merge($prependValue, $oldValue);

        $this->put($name, $newValue);

        return $this;
    }
543138
function Join(Table $table, JoinType $join, Condition $condition, $prepend = false)
    {
        $result = $this->Duplicate();
        if ($prepend)
        {
            array_unshift($result->tables, $table);
            array_unshift($result->joins, $join);
            array_unshift($result->conditions, $condition);
        }
        else
        {    
            $result->tables[] = $table;
            $result->joins[] = $join;
            $result->conditions[] = $condition;
        }
        return $result;
    }
256402
public function prePersist(LifecycleEventArgs $args) : void
    {
        $entity = $args->getEntity();

        if ($entity instanceof CreatedInterface) {
            $entity->setCreatedAt(new \DateTime());
        }
    }
906358
private function prepSelectRelTable(Table &$relTable, array $callArgs) {
        foreach ($callArgs[0] as $method => $args) {
            if ($method === 'where') continue;
            if (method_exists($relTable, $method)) {
                $args = is_array($args) ? $args : array($args);
                $relTable = call_user_func_array(array($relTable, $method),
                        $args);
            }
        }
        return $relTable;
    }
233130
public void prependPath(Object referrer, int index)
    {
        Reference ref = new Reference(referrer, index);
        prependPath(ref);
    }
424528
protected function prepareUpdate($table, $values, $where){
        $sql= 'UPDATE ' . $table . ' SET ';
        foreach ($values as $key => $value) {
            $sql .= $key . '=:' . $key . ',';
        }
        $sql = trim($sql, ',');
        if($where != ''){$sql.= " WHERE " . $where;}
        //Preparo la consulta y la retorno
        return  $this->connection->prepare($sql);
    }
483900
public function addVotable(UploaderVotableInterface $votable, $prepend = false)
    {
        if ($prepend) {
            array_unshift($this->votables, $votable);
        } else {
            $this->votables[] = $votable;
        }
    }
658883
public function findPublishedItems(
    array $where,
        $orderBy = null,
        $limit = null
    )
    {
        return $this->repository->findBy(array_merge($where, ['published' => true]), $orderBy, $limit);
    }
60399
public function addHeader ($string, $prepend = false)
		{
			if ($prepend) {
				$this->prependHeader($string);
			} else {
				$this->headers[] = $string;
			}
		}
991692
public function addHandler(Handler $handler, $getsPrevious = true, $prepend = false)
    {
        foreach ($this->handlers as $level => $handlers) {
            if ($handler->accepts($level)) {
                if ($prepend) {
                    array_unshift($this->handlers[$level], $handler);
                } else {
                    array_push($this->handlers[$level], $handler);
                }
            }
        }
        if ($getsPrevious) {
            $records = array();
            foreach ($this->log as $record) {
                if ($handler->accepts($record['level'])) {
                    $records[] = $record;
                }
            }
            if (count($records)) {
                $handler->handleBatch($records);
            }
        }
    }
400339
private function loadByWhere(array $where): Record
    {
        $this->_loaded = true;
        $this->_data = $this->_table->row('*', $where)->toArray();
        return $this;
    }
940516
private function appendSortBy($sortBy, $sortMethod, $search)
    {
        foreach ($sortBy as $column) {
            $search->addSort(new FieldSort($column, $sortMethod));
        }
    }
1009904
@PrePersist
    void prePersist() {
        // before persisting the entity check the current ID of the tenant by
        // using the TenantAware
        // service
        final String currentTenant = SystemManagementHolder.getInstance().currentTenant();
        if (currentTenant == null) {
            throw new TenantNotExistException("Tenant "
                    + TenantAwareHolder.getInstance().getTenantAware().getCurrentTenant()
                    + " does not exists, cannot create entity " + this.getClass() + " with id " + super.getId());
        }
        setTenant(currentTenant.toUpperCase());
    }
245189
public function deleteWhere(array $where)
    {
        $this->applyScope();

        $temporarySkipPresenter = $this->skipPresenter;
        $this->skipPresenter(true);

        $this->applyConditions($where);

        $deleted = $this->model->delete();

        event(new RepositoryEntityDeleted($this, $this->model->getModel()));

        $this->skipPresenter($temporarySkipPresenter);
        $this->resetModel();

        return $deleted;
    }
1153695
protected function appendSortBy($sortBy, $sortMethod, QueryBuilder $queryBuilder, $alias, $locale)
    {
        foreach ($sortBy as $column) {
            if (!in_array(explode('.', $column)[0], $queryBuilder->getAllAliases())) {
                $this->appendSortByJoins($queryBuilder, $alias, $locale);
            }

            $queryBuilder->orderBy($column, $sortMethod);
        }
    }
358276
public function prepend(): void
    {
        $script = $this->parseArgs(func_get_args());
        if ($script !== false) {
            array_unshift($this->members, $script);
        }
    }