public function getObject()
    {
        if ($this->sourceObject === null && $this->isSourceObjectResolved === false) {
            $this->isSourceObjectResolved = true;

            try {
                $model = $this->modelFactory()->create($this->objectType())->load($this->objectId());
                if ($model->id()) {
                    $this->sourceObject = $model;
                }
            } catch (Exception $e) {
                throw new LogicException(sprintf(
                    'Could not load the source object of the relationship: %s',
                    $e->getMessage()
                ), 0, $e);
            }
        }

        return $this->sourceObject;
    }
public function getObject()
    {
        if ($this->sourceObject === null && $this->isSourceObjectResolved === false) {
            $this->isSourceObjectResolved = true;

            try {
                $model = $this->modelFactory()->create($this->objectType())->load($this->objectId());
                if ($model->id()) {
                    $this->sourceObject = $model;
                }
            } catch (Exception $e) {
                throw new LogicException(sprintf(
                    'Could not load the source object of the relationship: %s',
                    $e->getMessage()
                ), 0, $e);
            }
        }

        return $this->sourceObject;
    }
public function getObject ( ) { if ( $ this -> sourceObject === null && $ this -> isSourceObjectResolved === false ) { $ this -> isSourceObjectResolved = true ; try { $ model = $ this -> modelFactory ( ) -> create ( $ this -> objectType ( ) ) -> load ( $ this -> objectId ( ) ) ; if ( $ model -> id ( ) ) { $ this -> sourceObject = $ model ; } } catch ( Exception $ e ) { throw new LogicException ( sprintf ( 'Could not load the source object of the relationship: %s' , $ e -> getMessage ( ) ) , 0 , $ e ) ; } } return $ this -> sourceObject ; }
Retrieve the source object of the relationship.

@throws LogicException If the relationship is broken or incomplete.
@return ModelInterface|null
Retrieve the source object of the relationship .