Drest\DrestException::invalidExposeRelationFetchType PHP Method

invalidExposeRelationFetchType() public static method

public static invalidExposeRelationFetchType ( )
    public static function invalidExposeRelationFetchType()
    {
        return new self('Invalid relation fetch type used. ' . 'Please see Doctrine\\ORM\\Mapping\\ClassMetadataInfo::FETCH_* for available options');
    }

Usage Example

示例#1
0
 /**
  * Set the exposure fields by following relations that have the a certain fetch type.
  * This is useful if you only want to display fields that are loaded eagerly.
  * eg ->setExposureRelationsFetchType(ORMClassMetaDataInfo::FETCH_EAGER)
  * @param  integer        $fetch
  * @throws DrestException
  */
 public function setExposureRelationsFetchType($fetch)
 {
     switch ($fetch) {
         case ORMClassMetaDataInfo::FETCH_EAGER:
         case ORMClassMetaDataInfo::FETCH_LAZY:
         case ORMClassMetaDataInfo::FETCH_EXTRA_LAZY:
         case null:
             $this->_attributes['defaultExposureRelationsFetchType'] = $fetch;
             break;
         default:
             throw DrestException::invalidExposeRelationFetchType();
     }
 }