/** * 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(); } }