Neomerx\JsonApi\Contracts\Encoder\Parameters\ParametersAnalyzerInterface::hasSomeFields PHP Méthode

hasSomeFields() public méthode

If field-sets allows any fields to be in output (field-set filter is not empty array).
public hasSomeFields ( string $type ) : boolean
$type string
Résultat boolean
    public function hasSomeFields($type);

Usage Example

 /**
  * @param Frame $current
  *
  * @return void
  */
 private function setResourceCompleted(Frame $current)
 {
     // Add resource if it is a main resource (even if it has no fields) or
     // if field set allows any fields for this type (filter out resources with no attributes and relationships)
     if ($current->getLevel() === 1 || $this->parameterAnalyzer->hasSomeFields($current->getResource()->getType()) === true) {
         $resourceObject = $current->getResource();
         $this->document->setResourceCompleted($resourceObject);
     }
 }