Find a changeset with status RUNNING

@return null|AclChangeset
497675
public function findRunningChangeset()
    {
        $qb = $this->createQueryBuilder('ac')
            ->select('ac')
            ->where('ac.status = :status')
            ->addOrderBy('ac.id', 'ASC')
            ->setMaxResults(1)
            ->setParameter('status', AclChangeset::STATUS_RUNNING);

        return $qb->getQuery()->getOneOrNullResult();
    }
1024799
public function isSynced()
    {
        $implicit = $this->calculateImplicit();

        // Check the existing implicit ChangeSetItems for this ChangeSet

        foreach ($this->Changes()->filter(['Added' => ChangeSetItem::IMPLICITLY]) as $item) {
            $objectKey = $this->implicitKey($item);

            // If a ChangeSetItem exists, but isn't in $implicit -> validation failure
            if (!array_key_exists($objectKey, $implicit)) {
                return false;
            }
            // Exists, remove from $implicit
            unset($implicit[$objectKey]);
        }

        // If there's anything left in $implicit -> validation failure
        return empty($implicit);
    }
488603
def get_changeset(self, revision=None):
        
        if isinstance(revision, GitChangeset):
            return revision
        revision = self._get_revision(revision)
        changeset = GitChangeset(repository=self, revision=revision)
        return changeset
647568
public function getUpdatedBy()
    {
        $updatedByAttribute = $this->updatedByAttribute;
        return (!is_string($updatedByAttribute) || empty($updatedByAttribute)) ? null : $this->$updatedByAttribute->getData();
    }
834134
public function changes()
    {
        $changes = [];
        foreach ($this->changedAttributes as $attrName => $originalValue) {
            $changes[$attrName] = [$originalValue, $this->attributes->get($attrName)];
        }
        return $changes;
    }
315027
public function getChanges()
    {
        $changes = [];

        foreach ($this->originals as $name => $original) {
            if ($this->hasChange($name)) {
                $changes[$name] = $this->$name;
            }
        }

        return $changes;
    }
846594
public function isChanged()
    {
        $snapshot = $this->_snapshot;
        if (!is_array($snapshot)) {
            return true;
        }
        $metadata = $this->getModelsMetaData();
        $attrs = $metadata->getNonPrimaryKeyAttributes($this);
        $automatic = $metadata->getAutomaticUpdateAttributes($this);
        $bindDataTypes = $metadata->getBindTypes($this);
        foreach ($attrs as $name) {
            if (isset($automatic[$name])) {
                continue;
            }
            $value = $this->readAttribute($name);
            $snapshotValue = ArrayHelper::fetch($snapshot, $name);
            if ($value === null) {
                if ($snapshotValue !== null) {
                    return true;
                }
            } else {
                if ($snapshotValue === null) {
                    return true;
                }
                $bindType = ArrayHelper::fetch($bindDataTypes, $name);
                switch ($bindType) {
                    case Column::TYPE_DATE:
                    case Column::TYPE_VARCHAR:
                    case Column::TYPE_DATETIME:
                    case Column::TYPE_CHAR:
                    case Column::TYPE_TEXT:
                    case Column::TYPE_VARCHAR:
                    case Column::TYPE_BIGINTEGER:
                        if (((string)$value) !== ((string)$snapshotValue)) {
                            return true;
                        }
                        break;
                    default:
                        if ($value != $snapshotValue) {
                            return true;
                        }
                }
            }
        }
        return false;
    }
998849
public function getUpdated()
    {
        $set = new ArrayList();
        foreach ($this->updated as $arrItem) {
            $set->push(ArrayData::create($arrItem));
        }
        return $set;
    }
536161
def get_changeset(self, revision=None):
        
        revision = self._get_revision(revision)
        changeset = MercurialChangeset(repository=self, revision=revision)
        return changeset
173567
public function hasChanges()
    {
        if ($this->hasChanges) {
            return $this->hasChanges;
        }

        $this->hasChanges = count($this->newResources) > 0 || count($this->deletedResources) > 0 || count($this->updatedResources) > 0;

        return $this->hasChanges;
    }
1161612
public function hasChange()
    {
        return !is_null($this->resource) && ($this->resource->hasFields() || $this->resource->hasIndexes());
    }
1311566
public function getStatus()
    {
        $this->initialize();
        if ( ! ($this->riakClient instanceof RiakClient)) {
            return null;
        }

        return $this->riakClient->status;
    }
227607
public function findChangedByGit(): ?\Generator
    {
        // -u expand dir's files
        [, $output,] = Sys::run('git status -s -u', $this->basePath);

        // 'D some.file'    deleted
        // ' M some.file'   modified
        // '?? some.file'   new file
        foreach (\explode("\n", \trim($output)) as $file) {
            $file = \trim($file);

            // only php file.
            if (!\strpos($file, '.php')) {
                continue;
            }

            // modified files
            if (\strpos($file, 'M ') === 0) {
                yield \substr($file, 2);

                // new files
            } elseif (\strpos($file, '?? ') === 0) {
                yield \substr($file, 3);
            }
        }
    }
739025
public function run(Changeset $changeset)
    {
        $diff = new Diff($changeset->getDiff());

        if (!count($diff)) {
            return 0;
        }

        $reporter = new Reporter($diff, $this->config);

        $runner = new BaseRunner();
        $runner->config = $this->config;
        $runner->reporter = $reporter;
        $runner->init();

        $it = new Iterator($diff, $changeset, $runner->ruleset, $this->config);

        /** @var File $file */
        foreach ($it as $file) {
            $runner->processFile($file);
        }

        $reporter->printReports();

        return (int) ($reporter->totalErrors || $reporter->totalWarnings);
    }
776278
public function getUpdatedAt() : ?string 
    {
        if ( ! $this->hasUpdatedAt()) {
            $this->setUpdatedAt($this->getDefaultUpdatedAt());
        }
        return $this->updatedAt;
    }
906545
private static function lookupRequestedChange()
    {
        // Only run if the query param is present
        if (!$change_id = request(Change::QUERY_KEY)) {
            return;
        }

        // Don't execute for classes that result in recusirve queries when the
        // Change model gets built below
        $class = get_called_class();
        if (in_array($class, [Change::class, Admin::class, Image::class])) {
            return;
        }

        // Check whether the referenced Change is for this class
        $change = Change::find($change_id);
        if ($class == $change->model) {
            return $change;
        }
    }
838675
function callbackGroupStatusChange(?\CharlotteDunois\Yasmin\Models\Guild $guild, \CharlotteDunois\Livia\Commands\CommandGroup $group, bool $enabled) {
        if(!empty($this->setup[$this->getGuildID($guild)])) {
            return;
        }
        
        $this->set($guild, 'group-'.$group->id, $enabled);
    }