@param UserObject $object

@return \eZ\Publish\API\Repository\Values\ContentType\ContentType|null
16204
protected function getContentType(UserObject $object)
    {
        if (isset($object->data['content_type'])) {
            return $this->contentTypeService->loadContentTypeByIdentifier($object->data['content_type']);
        }

        return;
    }
751512
private function mapUserToCreatedContent(User $user)
    {
        return new CreatedContent([
            'content' => new RestContent(
                $user->contentInfo,
                $this->repository->getLocationService()->loadLocation($user->contentInfo->mainLocationId),
                $this->repository->getContentService()->loadContentByContentInfo($user->contentInfo),
                $this->repository->getContentTypeService()->loadContentType($user->contentInfo->contentTypeId),
                $this->repository->getContentService()->loadRelations($user->versionInfo)
            ),
        ]);
    }
443741
public static function getPropertyValue($object,$propertyName)
    {
        $getter = "get" . ucfirst($propertyName);
        if (method_exists($object, $getter)) {
            return $object->$getter();
        }
        return null;
    }
589905
public function findBySubject(ContentSubjectInterface $subject)
    {
        $content = $subject->getContent();

        if (null !== $content && property_exists($content, '__isInitialized__') && !$content->{'__isInitialized__'}) {
            $qb = $this->getQueryBuilder();
            $qb
                ->leftJoin('c.containers', 'container')
                ->leftJoin('container.rows', 'row')
                ->leftJoin('row.blocks', 'block')
                ->leftJoin('block.translations', 'block_t')
                ->select('PARTIAL c.{id}', 'container', 'row', 'block', 'block_t')
                ->andWhere($qb->expr()->eq('c.id', ':id'))
                ->getQuery()
                ->useQueryCache(true)
                // TODO ->useResultCache(true, 3600, Content::getEntityTagPrefix() . '[id:'.$id.']')
                ->setParameter('id', $content->getId())
                ->getOneOrNullResult();
        }

        return $content;
    }
269191
static function typeForObject( $object )
    {
        if ( !$object )
            return false;
        $class = $object->contentClass();
        if ( !$class )
            return false;

        $ini = eZINI::instance( 'collect.ini' );
        $typeList = $ini->variable( 'InfoSettings', 'TypeList' );

        $classID = $class->attribute( 'id' );
        $classIdentifier = $class->attribute( 'identifier' );

        $type = false;

        if ( isset( $typeList[$classID] ) )
            $type = $typeList[$classID];
        else if ( isset( $typeList[$classIdentifier] ) )
            $type = $typeList[$classIdentifier];

        $typeAttribute = $ini->variable( 'InfoSettings', 'TypeAttribute' );
        if ( $typeAttribute )
        {
            $dataMap = $object->attribute( 'data_map' );
            if ( isset( $dataMap[$typeAttribute] ) )
            {
                $type = $dataMap[$typeAttribute]->content();
                if ( is_array( $type ) or
                     is_object( $type ) )
                    $type = false;
            }
        }

        if ( !$type )
            $type = $ini->variable( 'InfoSettings', 'Type' );

        return $type;
    }
1321636
public function readObject($object = null)
    {
        if ($object === null) {
            $object = array();
        }

        while (true) {
            $key        = $this->_stream->readUTF();
            $typeMarker = $this->_stream->readByte();
            if ($typeMarker != Zend_Amf_Constants::AMF0_OBJECTTERM ){
                //Recursivly call readTypeMarker to get the types of properties in the object
                $object[$key] = $this->readTypeMarker($typeMarker);
            } else {
                //encountered AMF object terminator
                break;
            }
        }
        $this->_reference[] = $object;
        return (object) $object;
    }
525772
public function persistWithoutPreAndPostPersist($object, $flushed = true)
    {
        $em = $this->getEntityManager();
        $em->persist($object);
        if ($flushed) {
            $em->flush($object);
        }
        return $object;
    }
321690
function contentObject()
    {
        if ( $this->ContentObject === null )
        {
            if ( $this->ContentObjectID == 0 )
            {
                return null;
            }
            $this->ContentObject = eZContentObject::fetch( $this->ContentObjectID );
        }
        return $this->ContentObject;
    }
412852
protected function loadSyliusUser($userType, $email)
    {
        if (empty($email)) {
            return null;
        }

        /** @var \Sylius\Component\User\Repository\UserRepositoryInterface $userRepository */
        $userRepository = $this->getContainer()->get(
            sprintf('sylius.repository.%s_user', $userType)
        );

        return $userRepository->findOneByEmail($email);
    }
195898
static function isUserObject( $contentObject )
    {
        if ( !$contentObject )
        {
            return false;
        }

        eZDataType::loadAndRegisterType( 'ezuser' );

        $contentClass = $contentObject->attribute( 'content_class' );
        $classAttributeList = $contentClass->fetchAttributes();
        foreach( $classAttributeList as $classAttribute )
        {
            if ( $classAttribute->attribute( 'data_type_string' ) == eZUserType::DATA_TYPE_STRING )
                return true;
        }

        return false;
    }
277035
protected function bindContext($object = NULL)
	{
		if($object !== NULL && !is_object($object))
		{
			throw new \InvalidArgumentException(sprintf('Expecting an object, given %s', gettype($object)));
		}
	
		$previous = $this->context;
		$this->context = $object;
	
		if($object === NULL)
		{
			$this->proxies = new \SplObjectStorage();
			
			return $previous;
		}
		
		if($this->contextualInstances->offsetExists($object))
		{
			$this->proxies = $this->contextualInstances[$object];
		}
		else
		{
			$this->proxies = new \SplObjectStorage();
			$this->contextualInstances[$object] = $this->proxies;
		}
	
		return $previous;
	}
664516
public function setContentObject($contentObject)
    {
        if (!is_object($contentObject)) {
            throw new \InvalidArgumentException('Argument must be an object, ' . \gettype($contentObject) . ' given.', 1283522467);
        }
        if ($this->contentObjectProxy === null || $this->contentObjectProxy->getObject() !== $contentObject) {
            $this->contentObjectProxy = new ContentObjectProxy($contentObject);
            $this->addOrUpdate();
        }
    }
923924
protected function optimizeObjectContent($object)
	{
		$object = $this->recordObject($object);
		$this->deduplicateConfigValues();

		return $object->getValue();
	}
925943
public function getUserAgentObject($userAgent = null)
    {
        if (!$userAgent) {
            $userAgent = $this->getUserAgentByRequest();
        }
        $objectData = ArrayHelper::merge(
            ['class' => 'yii\useragentparser\UserAgentObject','userAgent'=>$userAgent],
            $this->parseUserAgent($userAgent)
        );

        return Yii::createObject($objectData);
    }
389946
protected function getObjectDisplay($object = null)
    {
        if (!$object || !$object->isInDB()) {
            return '';
        }

        // Use image tag
        // TODO Use CMSThumbnail instead to limit max size, blocked by DataDifferencerTest and GC
        // not playing nice with mocked images
        if ($object instanceof Image) {
            return $object->getTag();
        }

        // Format title
        return $object->obj('Title')->forTemplate();
    }
526881
public function getUser($user)
    {
        $result = null;
        if ($user === 'current') {
            $u = new \User();
            if ($u->isRegistered()) {
                $result = $u;
            }
        } elseif (is_int($user) || (is_string($user) && is_numeric($user))) {
            $result = \User::getByUserID($user);
        } elseif ($user instanceof UserService) {
            $result = $user;
        } elseif ($user instanceof UserEntity) {
            $result = \User::getByUserID($user->getUserID());
        }

        return $result;
    }
221731
public function asObject($asObject = null)
    {
        if ($asObject === null)
        {
            return $this->_asObject;
        }
        $this->_asObject = $asObject;

        return $this;
    }