Get the modified state of the collection.

@return boolean
17840
public function modified($options = [])
    {
        $options += ['embed' => false];

        if ($this->_modified) {
          return true;
        }

        foreach ($this->_data as $index => $entity) {
            if (is_object($entity) && method_exists($entity, 'modified') && $entity->modified($options)) {
                return true;
            }
        }
        return false;
    }
667151
public function modified()
    {
        $path = $this->get('filepath');

        if (!file_exists($path)) {
            return null;
        }

        return filemtime($path) ?: null;
    }
998849
public function getUpdated()
    {
        $set = new ArrayList();
        foreach ($this->updated as $arrItem) {
            $set->push(ArrayData::create($arrItem));
        }
        return $set;
    }
760720
public function isAllowedToNotify()
    {
        if (!$this->changeSet || !isset($this->changeSet['mask'])) {
            return false;
        }
        if ('ROLE_ANONYMOUS' === $this->role->getName() || 'ROLE_USER' === $this->role->getName()) {
            return false;
        }

        $oldState = $this->changeSet['mask'][0];
        $newState = $this->changeSet['mask'][1];

        return 0 === $oldState % 2 && 1 === $newState % 2;
    }
183215
public function isVersioned()
    {
        if (!$this->ObjectClass || !class_exists($this->ObjectClass)) {
            return false;
        }
        /** @var Versioned|DataObject $singleton */
        $singleton = DataObject::singleton($this->ObjectClass);
        return $singleton->hasExtension(Versioned::class) && $singleton->hasStages();
    }
421062
public function areDirty()
    {
        if (true === parent::areDirty()) {
            return true;
        }
        foreach ($this->getOriginalAll() as $collection) {
            if (true === $collection->isDirty()) {
                return true;
            }
        }
        return false;
    }
907361
public function isLoaded(): bool
    {
        return $this->getState() != ORMInterface::STATE_NEW
            && $this->getState() != ORMInterface::STATE_DELETED
            && $this->getState() != ORMInterface::STATE_SCHEDULED_DELETE;
    }
877732
public function isArchived()
    {
        $id = $this->owner->ID ?: $this->owner->OldID;
        return $id && !$this->isOnDraft() && !$this->isPublished();
    }
838671
public function current()
    {
        $value = current($this->data);

        return AccessHelper::isCollectionType($value) ? new static($value, $this->options) : $value;
    }
1225124
public function hasChanged(): bool
    {
        return ! (empty($this->addAttributes) && empty($this->updateAttributes) && empty($this->removeAttributes));
    }
1189326
public function hasChange()
    {
        return (
            count($this->getFieldsWithUpdate()) > 0
            || count($this->getIndexesWithUpdate()) > 0
            || $this->addSoftDelete
            || $this->dropSoftDelete
            || $this->addTimestamps
            || $this->dropTimestamps);
    }
894815
public function hasChanges(): bool
    {
        foreach ($this->getTables() as $table) {
            if ($table->getComparator()->hasChanges()) {
                return true;
            }
        }

        return false;
    }
249148
public function hasChanged()
    {
        foreach ($this->modelData as $property => $value) {
            if ($this->hasPropertyChanged($property)) {
                return true;
            }
        }

        // In case model data has been manually unset
        $manuallyUnsetProperties = array_diff_key($this->changeSnapshotData, $this->modelData);
        foreach ($manuallyUnsetProperties as $property => $value) {
            // If it wasn't null before, that's a change
            if ($value !== null) {
                return true;
            }
        }

        return false;
    }
609378
public function calculateChangeSet()
    {
        $set = [];
        foreach ($this->getOriginalAll() as $key => $collection) {
            if (false === $collection->isDirty()) {
                continue;
            }
            $set[$key] = $collection->calculateChangeSet();
        }
        return $set;
    }
331719
private function modify()
    {
        if ($this->isIndex()) {
            $this->query = $this->modifyIndex($this->query);
        }
        else if ($this->isShow()) {
            $this->query = $this->modifyShow($this->query);
        }
        else if ($this->isDelete()) {
            $this->query = $this->modifyDelete($this->query);
        }
        else if ($this->isUpdate()) {
            $this->query = $this->modifyUpdate($this->query);
        }

        return $this;
    }
987916
public function isChanged()
    {
        // When unbound, use the local changed flag
        if (! ($this->record instanceof DataObject)) {
            return $this->isChanged;
        }

        // Defer to parent record
        foreach ($this->compositeDatabaseFields() as $field => $spec) {
            $key = $this->getName() . $field;
            if ($this->record->isChanged($key)) {
                return true;
            }
        }
        return false;
    }
40680
public function current()
    {
        $value = parent::current();
        if (!isset($value['file'])) {
            $value['file'] = $this->collection->createDownload(array_intersect_key($value, ['_id' => true, 'filename' => true, 'length' => true, 'chunkSize' => true]));
        }
        return $value;
    }