Ejemplo n.º 1
0
    public function getContent($forceSynchronization=true)
    {
        if (!$this->content)
        {
            $contentObject = eZContentObject::fetchByRemoteID( $this->remoteId() );

            if ($contentObject instanceof eZContentObject)
            {
                $this->content = SQLIContent::fromContentObject( $contentObject );
            }

            if (!$contentObject || $forceSynchronization || $this->synchronizer->option('ForceSynchronization'))
            {
                $this->synchronize();
            }
        }

        return $this->content;
    }
    protected function getNamedContent($name, $forceSynchronization)
    {
        $contentName = 'content' . $name;
        if (!$this->$contentName)
        {
            $contentObject = eZContentObject::fetchByRemoteID( $this->{'remoteId' . $name}() );

            if ( !$forceSynchronization && !$this->synchronizer->option('ForceSynchronization') && $contentObject instanceof eZContentObject )
            {
                $this->$contentName = SQLIContent::fromContentObject( $contentObject );
                if ($this->$contentName instanceof SQLIContent)
                {
                    $this->{$contentName}->setActiveLanguage($this->source['pf_default_language']);
                }
            }
            else
            {
                $this->synchronize();
            }
        }

        return $this->$contentName;
    }