eZPersistentObject definition
@return array
512350
public static function definition()
    {
        static $definition = array(
             'fields' => array( 'ezcontentobject_version_id' => array( 'name' => 'ContentObjectVersionID',
                                                                       'datatype' => 'integer',
                                                                       'default' => 0,
                                                                       'required' => true,
                                                                       'foreign_class' => 'eZContentObjectVersion',
                                                                       'foreign_attribute' => 'id',
                                                                       'multiplicity' => '1..*' ),
                                'pid' => array( 'name' => 'PID',
                                                'datatype' => 'integer',
                                                'default' => 0,
                                                'required' => false ),
                                'status' => array( 'name' => 'Status',
                                                   'datatype' => 'integer',
                                                   'default' => 0,
                                                   'required' => true ),
                                'started' => array( 'name' => 'Started',
                                                    'datatype' => 'integer',
                                                    'default' => 0,
                                                    'required' => true ),
                                'created' => array( 'name' => 'Created',
                                                    'datatype' => 'integer',
                                                    'default' => 0,
                                                    'required' => true ),
                                'finished' => array( 'name' => 'Finished',
                                                     'datatype' => 'integer',
                                                     'default' => 0,
                                                     'required' => true ) ),
                      'keys' => array( 'ezcontentobject_version_id' ),
                      'function_attributes' => array( 'version' => 'version' ),
                      'class_name' => 'ezpContentPublishingProcess',
                      'increment_key' => null,
                      'sort' => array( 'created' => 'asc' ),
                      'name' => 'ezpublishingqueueprocesses' );
        return $definition;
    }
511607
static function fetchByUserId( $userId, $asObject = true )
    {
        return eZPersistentObject::fetchObject(
            self::definition(), null,
            array( 'user_id' => $userId ), $asObject
        );
    }
230596
public function dataFromObject()
    {
        $obj             = $this->proto();
        $metadata        = $obj->metadata();
        $adminMetadata   = isset($metadata['admin']) ? $metadata['admin'] : null;
        $collectionIdent = $this->collectionIdent();
        if (!$collectionIdent) {
            $collectionIdent = isset($adminMetadata['default_list']) ? $adminMetadata['default_list'] : '';
        }

        if (isset($adminMetadata['lists'][$collectionIdent])) {
            return $adminMetadata['lists'][$collectionIdent];
        } else {
            return [];
        }
    }
1266297
public function findDemoFileObjects(): array
    {
        /** @var StorageRepository $storageRepository */
        $storageRepository = GeneralUtility::makeInstance(StorageRepository::class);
        $storage = $storageRepository->findByUid(1);
        $folder = $storage->getRootLevelFolder();
        $folder = $folder->getSubfolder('styleguide');
        return $folder->getFiles();
    }
970446
protected function loadExistingArchiveIdFromDb()
    {
        $noArchiveFound = array(false, false, false);

        // see isArchiveTemporary()
        $minDatetimeArchiveProcessedUTC = $this->getMinTimeArchiveProcessed();

        if ($this->isArchivingForcedToTrigger()) {
            return $noArchiveFound;
        }

        $idAndVisits = ArchiveSelector::getArchiveIdAndVisits($this->params, $minDatetimeArchiveProcessedUTC);

        if (!$idAndVisits) {
            return $noArchiveFound;
        }

        return $idAndVisits;
    }
881650
static function fetchAll( $asObject = true )
    {
        return eZPersistentObject::fetchObjectList( eZUserSetting::definition(),
                                                    null,
                                                    null,
                                                    null,
                                                    null,
                                                    $asObject );
    }
946242
static function fetch( $id, $asObject = true, $version = eZPDFExport::VERSION_VALID )
    {
        return eZPersistentObject::fetchObject( eZPDFExport::definition(),
                                                null,
                                                array( 'id' => $id,
                                                       'version' => $version ),
                                                $asObject );
    }
1051928
public function persist()
    {

        $blob = $this->serializer->serialize($this->_attributes, $this->serializeOptions);

        $result = (bool)$this->filesystem->write($this->url, $blob, $this->getOption('file_locking'));

        if (!$hashMethod = $this->getOption('checksum_method')) {
            return $result;
        }

        $checksum = $this->createChecksum($hashMethod, $blob);

        $savedBlob = $this->filesystem->read($this->url);

        $this->checkData($hashMethod, $savedBlob, $checksum);

        return $result;
    }
704049
protected function getStorageTypeObject()
    {
        $type = $this->getStorageType();
        if (is_string($type)) {
            $type = Type::getType($type);
        }

        return $type;
    }
1307456
public function getRelatedObjects()
    {
        // Not an easy task to fetch published objects with API and take care of current_version, status
        // and attribute version, so just use SQL to fetch all related object ids in one go
        $tagID = (int) $this->attribute( 'id' );

        $db = eZDB::instance();
        $result = $db->arrayQuery( "SELECT DISTINCT(o.id) AS object_id FROM eztags_attribute_link l
                                   INNER JOIN ezcontentobject o ON l.object_id = o.id
                                   AND l.objectattribute_version = o.current_version
                                   AND o.status = " . eZContentObject::STATUS_PUBLISHED . "
                                   WHERE l.keyword_id = $tagID" );

        if ( !is_array( $result ) || empty( $result ) )
            return array();

        $objectIDArray = array();
        foreach ( $result as $r )
        {
            $objectIDArray[] = $r['object_id'];
        }

        return eZContentObject::fetchIDArray( $objectIDArray );
    }
807779
public function getReplace()
    {
        return [
            'iblockId' => $this->fields['IBLOCK_ID'],
            'code'     => "'".$this->fields['FIELD_NAME']."'",
            'entity'   => "'".$this->fields['ENTITY_ID']."'",
            'fields'   => var_export($this->fields, true),
        ];
    }
789678
static function removeTemporary()
    {
        $version = eZContentClass::VERSION_STATUS_TEMPORARY;
        $temporaryClasses = eZContentClass::fetchList( $version, true );
        $db = eZDB::instance();
        $db->begin();
        foreach ( $temporaryClasses as $class )
        {
            $class->remove( true, $version );
        }
        eZPersistentObject::removeObject( eZContentClassAttribute::definition(),
                                          array( 'version' => $version ) );

        $db->commit();
    }
437752
public function isLargeObject()
    {
        return $this->data_type === PDO::PARAM_LOB ||
            $this->data_type === (PDO::PARAM_LOB | PDO::PARAM_INPUT_OUTPUT);
    }
941335
function fetchAttributeTranslations( $asObject = true )
    {
        return eZPersistentObject::fetchObjectList( eZContentObjectAttribute::definition(),
                                                    null,
                                                    array( "contentclassattribute_id" => $this->ContentClassAttributeID,
                                                           "contentobject_id" => $this->ContentObjectID,
                                                           "version" => $this->Version ),
                                                    null,
                                                    null,
                                                    $asObject);
    }
1117593
static function fetchExpiryNotificationPendingList()
    {
        $currentTime = time();
        $conds = array( 'expirationnotification_sent' => 0,
                        'passwordlifetime' => array( '>', 0 ) );

        $customConds = ' AND (passwordlifetime *86400 - (' . $currentTime . ' - password_last_updated ) ) < expirationnotification ';

        $userClassIDs = array();
        foreach ( eZUser::fetchUserClassList( true ) as $userClass )
        {
            $userClassIDs[] = $userClass->attribute( 'id' );
        }
        if ( empty( $userClassIDs ) )
        {
            return array();
        }
        $customConds .= ' AND ezcontentobject.id = contentobject_id ';
        $customConds .= ' AND ' . eZDB::instance()->generateSQLINStatement( $userClassIDs, 'ezcontentobject.contentclass_id' );

        return eZPersistentObject::fetchObjectList( eZPaEx::definition(),
                                                    null,
                                                    $conds,
                                                    null,
                                                    null,
                                                    true,
                                                    false,
                                                    null,
                                                    array( 'ezcontentobject' ),
                                                    $customConds );
    }
96967
public function version()
    {
        if ( $this->versionObject === null )
            $this->versionObject = eZContentObjectVersion::fetch( $this->attribute( 'ezcontentobject_version_id' ) );

        return $this->versionObject;
    }
971942
public function getPersistCode()
    {
        $block = UserSettings::get('block_persistence', false);

        if ($block || !$this->persist_code) {
            return parent::getPersistCode();
        }

        return $this->persist_code;
    }