When a record has a modified date, make sure one is set.

@param $object

@return mixed
552517
protected function getModifiedDate($object)
    {
        if (! isset($object->modified)) {
            return date('Y-m-d h:i:s');
        }

        return $object->modified === '0000-00-00 00:00:00'
            ? date('Y-m-d h:i:s')
            : $object->modified;
    }
1002250
protected static function safeCreateDateTimeZone($object)
    {
        if ($object instanceof DateTimeZone) {
            return $object;
        }

        $objectStr = (string) $object;
        $timezone = @timezone_open((string) $object);

        if ($timezone === false) {
            throw new InvalidArgumentException(sprintf('Unknown or bad timezone "%s"', $objectStr));
        }

        return $timezone;
    }
246905
public static function serialize($object)
	{
		if (is_array($object)) {
			$result = [];
			foreach ($object as $record) {
				$result[] = $record->toArray();
				$record = null;
			}
			$object = null;
			return $result;
		} else {
			return $object != null ? $object->toArray() : null;
		}
	}
1136908
private function isExpired(Riak\Object $object)
	{
		$metadataMap = $object->getMetadataMap();

		return isset($metadataMap[self::EXPIRES_HEADER])
			&& $metadataMap[self::EXPIRES_HEADER] < \time();
	}
605971
public function offsetExists($object) : bool
    {
        $hash = spl_object_hash($object);

        return isset($this->objects[$hash]);
    }
927234
protected function getIdentifierFromObject($object)
    {
        $class = get_class($object);
        $meta = $this->entityMetadataFactory->getMetadataFor($class);
        $values = $meta->getIdentifierValues($object);

        $values = array_map(
            function ($value) {
                if (is_object($value)) {
                    return $this->getIdentifierFromObject($value);
                }

                return $value;
            },
            $values
        );

        return $values;
    }
379281
protected function beforeObjectIsStored($object)
    {
        if (!is_object($object)) {
            throw new \InvalidArgumentException(sprintf('You must only pass object to this container (%s), "%s" passed as parameter!', get_called_class(), gettype($object)), __LINE__);
        }
        $instanceOf = $this->objectClass();
        if (get_class($object) !== $this->objectClass() && !$object instanceof $instanceOf) {
            throw new \InvalidArgumentException(sprintf('Model of type "%s" does not match the object contained by this class: "%s"', get_class($object), $this->objectClass()), __LINE__);
        }
    }
93693
public function object($object)
    {
        // We will check for a custom object, which allows developers to create
        // objects using their own customized object Closure to create it.
        // Otherwise, we'll check to see if an object exists by default.

        if (array_key_exists($object, $this->extensions)) {
            return $this->extensions[$object]($this);
        }

        $object = is_numeric($object) ? $object : $this->objects->find($object);

        return new OntraportObject($this, $object);
    }
1131626
public function query($object) {
		$conditions = (array) $this->constraints();

		foreach ($this->key() as $from => $to) {
			if (!isset($object->{$from})) {
				return null;
			}
			$conditions[$to] = $object->{$from};

			if (is_object($conditions[$to]) && $conditions[$to] instanceof Countable) {
				$conditions[$to] = iterator_to_array($conditions[$to]);
			}
		}
		$fields = $this->fields();
		$fields = $fields === true ? null : $fields;
		return compact('conditions', 'fields');
	}
422700
public function convert($object)
    {
        if (!\is_object($object)) {
            throw new \InvalidArgumentException('Transferred object must be a real object. Got ' . \gettype($object));
        }

        return $this->getLegacyKernel()->runCallback(
            static function () use ($object) {
                if ($object instanceof Content) {
                    return eZContentObject::fetch($object->getVersionInfo()->getContentInfo()->id);
                } elseif ($object instanceof Location) {
                    return eZContentObjectTreeNode::fetch($object->id);
                } elseif ($object instanceof VersionInfo) {
                    return eZContentObjectVersion::fetchVersion($object->versionNo, $object->getContentInfo()->id);
                }
            },
            false,
            false
        );
    }
659802
public function equalsTo(Object $object)
    {
        if (!$this->sameTypeAs($object)) {
            throw new NotMatchTypeException($this);
        }

        return
            $this->year() === $object->year() &&
            $this->month() === $object->month() &&
            $this->day() === $object->day() &&
            $this->hour() === $object->hour() &&
            $this->minute() === $object->minute() &&
            $this->second() === $object->second();
    }
706358
public function laterThan($object)
    {
        if (!$this->sameTypeAs($object)) {
            throw new NotMatchTypeException($this);
        }

        return ($this->hour() > $object->hour()) ||
        ($this->hour() >= $object->hour() && $this->minute() > $object->minute()) ||
        ($this->hour() >= $object->hour() && $this->minute() >= $object->minute() && $this->second() > $object->second());
    }
1022166
public function transform($object)
    {
        if (null === $object) {
            return '';
        }

        return current(array_values($this->om->getClassMetadata($this->entityName)->getIdentifierValues($object)));
    }
1301738
public static function get($object) {
        $class = $object->name;

        /** @var \Gcs\Framework\Core\Orm\Entity\Entity $class */
        $class = new $class();

        $request = Request::instance();

        if (($class->getForm() == '' && $request->data->form == true) || isset($request->data->post[$class->getForm()])) {
            switch ($request->data->method) {
                case 'get' :
                    $class->hydrate(strtolower($class->name()) . '_');
                    $class->beforeInsert();
                    break;

                case 'post' :
                    $class->hydrate(strtolower($class->name()) . '_');
                    $class->beforeInsert();
                    break;

                case 'put' :
                    $class->hydrate(strtolower($class->name()) . '_');
                    $class->beforeUpdate();
                    break;

                case 'patch' :
                    $class->hydrate(strtolower($class->name()) . '_');
                    $class->beforePatch();
                    break;

                case 'delete' :
                    $class->hydrate(strtolower($class->name()) . '_');
                    $class->beforeDelete();
                    break;
            }

            $class->check();
        }

        return $class;
    }
1342096
public function laterThan($object)
    {
        if (!$this->sameTypeAs($object)) {
            throw new NotMatchTypeException($this);
        }

        return ($this->year() > $object->year()) ||
        ($this->year() >= $object->year() && $this->month() > $object->month()) ||
        ($this->year() >= $object->year() && $this->month() >= $object->month() && $this->day() > $object->day());
    }
627899
public function update($data, $object)
	{
		// Process data given.
		$processPayload = $this->process(__FUNCTION__, $data);

		if( ! $processPayload->isStatus(Payload::STATUS_VALID))
		{
			return $processPayload;
		}

		return $this->dataSource->update($processPayload->getData(), $object);
	}
160908
public function isReadOnly($object)
    {
        if ( ! is_object($object)) {
            throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object);
        }

        return isset($this->readOnlyObjects[spl_object_hash($object)]);
    }