Get updated at

If no "updated at" value has been set, this method will
set and return a default "updated at" value,
if any such value is available

@see getDefaultUpdatedAt()

@return string|null updated at or null if no updated at has been set
776278
public function getUpdatedAt() : ?string 
    {
        if ( ! $this->hasUpdatedAt()) {
            $this->setUpdatedAt($this->getDefaultUpdatedAt());
        }
        return $this->updatedAt;
    }
251699
private function getUpdateChangeSetHandler()
    {
        return function ($key, $value, $obj) {
            $op = '$set';
            if (null === $value) {
                $op = '$unset';
                $value = 1;
            }
            $obj[$op][$key] = $value;
            return $obj;
        };
    }
282192
public function getCreatedAt()
    {
        $createdAtAttribute = $this->createdAtAttribute;
        if (!is_string($createdAtAttribute) || empty($createdAtAttribute)) {
            return null;
        }
        return $this->$createdAtAttribute;
    }
1015483
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    @JsonProperty("updated_at")
    public Date getUpdatedAt() {
        return updatedAt;
    }
1333218
private function getPreparedInsertUpdate()
    {
        if (is_null($this->preparedInsertUpdate)) {
            $this->preparedInsertUpdate = $this->getServer()
                ->insert($this->tableName)
                ->set($this->keyColumnName, ':id')
                ->set($this->valueColumnName, ':value')
                ->set($this->expireColumnName, ':expire')
                ->onDuplicateKey($this->keyColumnName)
                ->set($this->valueColumnName, ':newValue')
                ->set($this->expireColumnName, ':newExpire');
        }

        return $this->preparedInsertUpdate;
    }
647568
public function getUpdatedBy()
    {
        $updatedByAttribute = $this->updatedByAttribute;
        return (!is_string($updatedByAttribute) || empty($updatedByAttribute)) ? null : $this->$updatedByAttribute->getData();
    }
799010
public function getUpdatedAt()
    {
        return ! empty($value = $this->getContentValue('updated_at', null))
            ? $this->convertToCarbon($value)
            : null;
    }
318038
public function getDefault()
    {
        if ($this->default) {
            return $this->default;
        }
        if (!empty($this->values)) {
            return reset($this->values);
        }
        return null;
    }
591845
public function getDeletedAt() : ?int 
    {
        if ( ! $this->hasDeletedAt()) {
            $this->setDeletedAt($this->getDefaultDeletedAt());
        }
        return $this->deletedAt;
    }
856801
public function get_static_value() {
        $value = $this->get_value();
        if ($value === false) {
            $value = $this->attributes['defaultvalue'];
        }
        if (!empty($value)) {
            if ($this->attributes['type'] === 'date_selector' ||
                    $this->attributes['type'] === 'date_time_selector') {
                return userdate($value);
            }
        }
        return $value;
    }
222607
protected function getRawValue()
    {
        $value = null;

        if ($this->name === null) {
            $value = parent::getRawValue();
        } else {
            $data = &$this->getForm()->getFormData();
            $id = $this->name;
            if (isset($data[$id]) && $data[$id] != '') {
                $value = $data[$id];
            }
        }

        return $value;
    }
266194
public function getDefaultDbData()
    {
        $class = get_called_class();
        if (!isset(self::$cachedDefaultDbData[$class])) {
            self::$cachedDefaultDbData[$class] = [];
            foreach (array_keys(static::$dbProperties) as $propertyName) {
                self::$cachedDefaultDbData[$class][$propertyName] = $this->getDefaultDbPropertyValue($propertyName);
            }
        }

        return self::$cachedDefaultDbData[$class];
    }
843755
public function getLast()
    {
        $this->internalDataListUpdate();
        $count = sizeof($this->internalDataListData);
        if (isset($this->internalDataListData[$count - 1])) {
            return $this->internalDataListUpdateValueIfNeeded($this->internalDataListData, $count - 1);
        }
        return null;
    }
850464
public function getLastUpdatedAt()
    {
        $qb = $this->createQueryBuilder('p');

        $date = $qb
            ->select('p.updatedAt')
            ->addOrderBy('p.updatedAt', 'DESC')
            ->getQuery()
            ->setMaxResults(1)
            ->getSingleScalarResult();

        if (null !== $date) {
            return new \DateTime($date);
        }

        return null;
    }
902643
public function getDefaultValue()
    {
        if (!$this->hasDefaultValue()) {
            return null;
        }

        if ($this->defaultValue instanceof FragmentInterface) {
            //Defined as SQL piece
            return $this->defaultValue;
        }

        if (in_array($this->getAbstractType(), ['time', 'date', 'datetime', 'timestamp'])) {
            return $this->formatDatetime($this->getAbstractType(), $this->defaultValue);
        }

        switch ($this->getType()) {
            case 'int':
                return (int)$this->defaultValue;
            case 'float':
                return (float)$this->defaultValue;
            case 'bool':
                if (is_string($this->defaultValue) && strtolower($this->defaultValue) == 'false') {
                    return false;
                }

                return (bool)$this->defaultValue;
        }

        return (string)$this->defaultValue;
    }
1107865
public function update($data = null)
    {
        $fields = $this->getFields();
        $sql1 = '';
        $args = array();
        foreach ($fields as $field) {
            if (in_array($field, $this->updated_at_fileds)) {
                $this->{$field} = now();
            }
            $value = $this->getFieldValue($field, $data);
            if (isset($value) && !$this->isIndex($field)) {
                $args[] = $value;
                $sql1 .= "`$field` = ?, ";
            }
        }
        if (!empty($sql1)) {
            $sql1 = substr($sql1, 0, -2);
            $index = $this->getIndex();
            $indexValue = $this->db->escape_string($this->getFieldValue($index, $data));
            if (!$indexValue) {
                return false;
            }
            $args[] = $indexValue;
            return $this->db->exec("UPDATE `{$this->table_name}` SET $sql1 WHERE `$index` = ?", $args, $this->getCacheId($indexValue));
        }
        return false;
    }
971196
public function getDirty()
    {
        $dirty = parent::getDirty();
        if (! empty($this->files)) {
            // We just set the ID to the same value to trigger the update.
            $dirty[$this->getKeyName()] = $this->getKey();
        }

        return $dirty;
    }