Generate array of paex objects to update based on updatechildren status

@param array $paex_to_update     Array of already updated paex objects
@return array of paex objects to update, with final values set.
496324
function generateUpdateChildren( $paexToUpdate = array() )
    {
        eZDebug::writeDebug( 'Start', __METHOD__ );

        if ( !$this->attribute( 'updatechildren' ) )
        {
            eZDebug::writeDebug( 'UpdateChildren flag disabled. Nothing to do.', __METHOD__ );
        }
        else
        {
            $newPasswordvalidationregexp = $this->attribute( 'passwordvalidationregexp' );
            $newPasswordlifetime = $this->attribute( 'passwordlifetime' );
            $newExpirationnotification = $this->attribute( 'expirationnotification' );

            // Fetch the main node that belongs to the current paex
            $mainNodeID = eZContentObjectTreeNode::findMainNode( $this->attribute( 'contentobject_id' ) );
            eZDebug::writeDebug( 'Going to update subtree starting at node ' . $mainNodeID . '.', __METHOD__ );

            // Fetch the full subtree array to update
            $fullSubtree = eZContentObjectTreeNode::subTreeByNodeID( array( "MainNodeOnly" => false,
                                                                            "AsObject" => false ),
                                                                    $mainNodeID );

            foreach ( $fullSubtree as $node )
            {
                // Fetch the paex for each node
                $addPaexToUpdate = eZPaEx::fetch( $node["contentobject_id"] );
                // If the paex is not marked to updatechildren, update the paex object
                if ( $addPaexToUpdate instanceof eZPaEx  &&
                     $addPaexToUpdate->attribute( 'updatechildren' ) != 1 )
                {
                    $addPaexToUpdate->setAttribute('passwordvalidationregexp', $newPasswordvalidationregexp );
                    $addPaexToUpdate->setAttribute('passwordlifetime', $newPasswordlifetime );
                    $addPaexToUpdate->setAttribute('expirationnotification', $newExpirationnotification );
                    $paexToUpdate[$node["contentobject_id"]] = $addPaexToUpdate;
                }
                else
                {
                    eZDebug::writeDebug( 'Skipping object ' . $add_paex_to_update['contentobject_id'] , __METHOD__ );
                }
            }
        }
        eZDebug::writeDebug( 'End', __METHOD__ );

        return $paexToUpdate;
    }
385917
protected function generateUpdateSQL(Update $update)
        {
            $updates = [];
            foreach ($update->getValues() as $column => $value) {
                $column = mb_substr($column, mb_strpos($column, '.') + 1);
                $prefix = Query::quoteIdentifier($column);
                $updates[] = $prefix . Criterion::EQUALS . '?';

                $this->addValue($value, true);
            }
            $sql = 'UPDATE ' . $this->getTable()->getSqlTableName() . ' SET ' . implode(', ', $updates);
            return $sql;
        }
1260800
public function upgradeDatabase()
    {
        $all_tables = $this->connection->executeQuery('SHOW TABLES LIKE "%ExpressSearchIndexAttributes"')->fetchAll();
        $all_tables = array_map(function ($row) {
            return array_values($row)[0];
        }, $all_tables);

        $entity_tables = [];

        $entities = \Core::make('express')->getEntities(true)->findAll();
        foreach ($entities as $entity) {
            /* @var $entity \Concrete\Core\Entity\Express\Entity */
            $entity_tables[] = $entity->getAttributeKeyCategory()->getIndexedSearchTable();
        }

        $drop_tables = array_diff($all_tables, $entity_tables);

        foreach ($drop_tables as $table) {
            $this->connection->exec('DROP TABLE IF EXISTS ' . $table);
        }
    }
1262865
public function updateLevelForChildrenElements($object)
    {

        $tmp = new \Doctrine\Common\Collections\ArrayCollection();

        $children = $this->findChildrenByParentId($object->getId());

        foreach ($children as $ch) {
            $tmp->add($ch);
        }

        while (!$tmp->isEmpty()) {
            $d = $tmp->first();
            $tmp->removeElement($d);
            $children = $d->getChildren();
            foreach ($children as $ch) {
                $tmp->add($ch);
            }
            $parent = $d->getParent();
            $d->setLevel($parent->getLevel() + 1);
            $this->updateWithoutPreAndPostUpdate($d);
        }

    }
621142
protected function generateUpdates()
    {
        $updates = array();

        if ($this->flush) {
            $updates[] = array('flush', array($this->cache, 'flush'), array());
        }

        foreach ($this->keys as $key => $data) {
            $updates[] = $data;
        }

        return $updates;
    }
1000376
def from_update(cls, update):
        
        expressions = []
        if update.set_expr:
            expressions.append(UpdateSetMany.from_clause(update.set_expr))
        if update.remove_expr:
            expressions.append(UpdateRemove.from_clause(update.remove_expr))
        if update.add_expr:
            expressions.append(UpdateAdd.from_clause(update.add_expr))
        if update.delete_expr:
            expressions.append(UpdateDelete.from_clause(update.delete_expr))
        return cls(expressions)
1235369
public function update($source=null) {
        // load the grade item or create a new one
        $this->load_grade_item();

        // force recalculation of path;
        if (empty($this->path)) {
            $this->path  = grade_category::build_path($this);
            $this->depth = substr_count($this->path, '/') - 1;
            $updatechildren = true;

        } else {
            $updatechildren = false;
        }

        $this->apply_forced_settings();

        // these are exclusive
        if ($this->droplow > 0) {
            $this->keephigh = 0;

        } else if ($this->keephigh > 0) {
            $this->droplow = 0;
        }

        // Recalculate grades if needed
        if ($this->qualifies_for_regrading()) {
            $this->force_regrading();
        }

        $this->timemodified = time();

        $result = parent::update($source);

        // now update paths in all child categories
        if ($result and $updatechildren) {

            if ($children = grade_category::fetch_all(array('parent'=>$this->id))) {

                foreach ($children as $child) {
                    $child->path  = null;
                    $child->depth = 0;
                    $child->update($source);
                }
            }
        }

        return $result;
    }
525379
protected function prepareUpdate(array $updates, $oneToOneRelation = false)
    {
        $prepared = [];

        /** @var Field $field */
        foreach ($this->builder->fields() as $field) {
            $columns = $field->column();

            // If column not in input array data, then continue.
            if (!Arr::has($updates, $columns)) {
                continue;
            }

            if ($this->invalidColumn($columns, $oneToOneRelation)) {
                continue;
            }

            $value = $this->getDataByColumn($updates, $columns);

            $value = $field->prepare($value);

            if (is_array($columns)) {
                foreach ($columns as $name => $column) {
                    Arr::set($prepared, $column, $value[$name]);
                }
            } elseif (is_string($columns)) {
                Arr::set($prepared, $columns, $value);
            }
        }

        return $prepared;
    }
150138
public function FilteredUpdates($pageSize = 20)
    {
        $params = $this->parseParams();

        $items = $this->Updates(
            $params['tag'],
            $params['from'],
            $params['to'],
            $params['year'],
            $params['month']
        );

        if ($params['upcomingOnly']) {
            $items = $items->filter(['Date:LessThan:Not' => DBDatetime::now()->Format('y-MM-dd')]);
        }

        // Apply pagination
        $list = PaginatedList::create($items, $this->getRequest());
        $list->setPageLength($pageSize);
        return $list;
    }
475248
public function getChildByIndex( $index )
	{
		if( $index > count( $this->children ) )
			throw new InvalidArgumentException( 'Child Node with Index "'.$index.'" is not existing.' );
		return $this->children[$index];
	}
551430
private function getPlatformUpdates()
    {
        /** @var ContainerHelper $helper */
        $helper = $this->getHelper('container');
        $app = $helper->getContainer();
        $platform = $app['db']->getDatabasePlatform();
        $platformName = $platform->getName();
        $schemaTables = $app['schema']->getSchemaTables();
        $tables = MutableBag::from([]);
        /** @var Table $table */
        foreach ($schemaTables as $table) {
            $tables[] = $table->getName();
        }

        if ($platformName === 'sqlite') {
            return MutableBag::from(['VACUUM', 'ANALYZE']);
        }

        if ($platformName === 'postgresql') {
            $updates = MutableBag::from(['VACUUM(FULL, ANALYZE)']);
            /** @var string $table */
            foreach ($tables as $table) {
                $updates[] = 'REINDEX TABLE ' . $table;
            }

            return $updates;
        }

        if ($platformName === 'mysql') {
            return MutableBag::from([
                'ANALYZE TABLE ' . $tables->join(', '),
                'OPTIMIZE TABLE ' . $tables->join(', '),
            ]);
        }

        throw new RuntimeException(sprintf('Unsupported platform: %s', $platformName));
    }
79164
public function updateOverrideFiles(): array
    {
        $filesUpdated = [];
        $fileSame     = [];
        foreach ($this->getOverridesIterator() as $pathToFileInOverrides) {
            $relativePathToFileInProject = $this->getRelativePathInProjectFromOverridePath($pathToFileInOverrides);
            if ($this->projectFileIsSameAsOverride($pathToFileInOverrides)) {
                $fileSame[] = $relativePathToFileInProject;
                continue;
            }
            $pathToFileInProject = $this->pathToProjectRoot . $relativePathToFileInProject;
            if (false === is_file($pathToFileInProject)) {
                throw new \RuntimeException('path ' . $pathToFileInProject . ' is not a file');
            }
            copy($pathToFileInProject, $pathToFileInOverrides);
            $filesUpdated[] = $relativePathToFileInProject;
        }

        return [$this->sortFiles($filesUpdated), $this->sortFiles($fileSame)];
    }
10920
public function update($token, $_params = array()) 
	{
        return $this->transform($this->master->put('resources/' . $token, $_params), true);
    }
1157973
public function UpdateItem()
    {
        $pathExpr = $this->SingleValuedPathExpression();

        $this->match(Lexer::T_EQUALS);

        $updateItem = new AST\UpdateItem($pathExpr, $this->NewValue());

        return $updateItem;
    }
613875
protected function buildUpdateUpdatePayload(Update $update)
    {
        $payload = array(
            'text' => $update->text,
            'now' => $update->now,
        );

        if ( ! empty($update->media)) {
            $payload['media'] = $update->media;
        }

        if ( ! is_null($update->scheduled_at)) {
            $payload['scheduled_at'] = $update->scheduled_at;
        }

        return $payload;
    }
567689
function compileUpdate()
    {
        $updateManager = new UpdateManager;
        $updateManager->table($this->nodes->source->getLeft());

        foreach ($this->nodes->restrictions as $expr) {
            $updateManager->where($expr);
        }

        foreach ($this->nodes->orders as $order) {
            $updateManager->order($order);
        }

        empty($this->nodes->limit) ?:
            $updateManager->take($this->nodes->limit->getExpression());

        empty($this->nodes->offset) ?:
            $updateManager->skip($this->nodes->offset->getExpression());

        return $updateManager;
    }
277534
public function getChanged(UserUpdater $update)
    {
        $changed = [];
        $ref = new \ReflectionClass($this);
        foreach ($ref->getProperties() as $prop) {
            $method = 'get' . ucfirst($prop->getName());
            $newVal = $update->$method();
            if ($this->$method() != $newVal) {
                $changed[$prop->getName()] = $newVal;
            }
        }

        return $changed;
    }