public function fetchLocatable(AnCommandContext $context)
    {
        $this->locatable = AnService::get('repos:nodes.node')
                           ->getQuery()
                           ->disableChain()
                           ->id($this->locatable_id)
                           ->fetch();

        if(!$this->locatable) {
            throw new LibBaseControllerExceptionNotFound('Locatable object does not exist');
        }

        if(!$this->locatable->getRepository()->hasBehavior('geolocatable')) {
            throw new LibBaseControllerExceptionBadRequest('Object does not have locatable behavior');
        }

        return $this->locatable;
    }
public function fetchLocatable(AnCommandContext $context)
    {
        $this->locatable = AnService::get('repos:nodes.node')
                           ->getQuery()
                           ->disableChain()
                           ->id($this->locatable_id)
                           ->fetch();

        if(!$this->locatable) {
            throw new LibBaseControllerExceptionNotFound('Locatable object does not exist');
        }

        if(!$this->locatable->getRepository()->hasBehavior('geolocatable')) {
            throw new LibBaseControllerExceptionBadRequest('Object does not have locatable behavior');
        }

        return $this->locatable;
    }
public function fetchLocatable ( AnCommandContext $ context ) { $ this -> locatable = AnService :: get ( 'repos:nodes.node' ) -> getQuery ( ) -> disableChain ( ) -> id ( $ this -> locatable_id ) -> fetch ( ) ; if ( ! $ this -> locatable ) { throw new LibBaseControllerExceptionNotFound ( 'Locatable object does not exist' ) ; } if ( ! $ this -> locatable -> getRepository ( ) -> hasBehavior ( 'geolocatable' ) ) { throw new LibBaseControllerExceptionBadRequest ( 'Object does not have locatable behavior' ) ; } return $ this -> locatable ; }
Method to fetch the locatable object
Method to fetch the locatable object