Sulu\Component\Rest\ListBuilder\Metadata\Doctrine\Type\CaseTypeMetadata::addCase PHP Method

addCase() public method

Add a case.
public addCase ( FieldMetadata $case )
$case Sulu\Component\Rest\ListBuilder\Metadata\Doctrine\FieldMetadata
    public function addCase(FieldMetadata $case)
    {
        $this->cases[] = $case;
    }

Usage Example

Esempio n. 1
0
 /**
  * Extracts case-type for property-node.
  *
  * @param \DOMXPath $xpath
  * @param \DOMElement $propertyNode
  *
  * @return CaseTypeMetadata
  */
 protected function getCaseType(\DOMXPath $xpath, \DOMElement $propertyNode)
 {
     $type = new CaseTypeMetadata();
     foreach ($xpath->query('orm:field', $propertyNode) as $fieldNode) {
         if (null === ($case = $this->getField($xpath, $fieldNode))) {
             continue;
         }
         $type->addCase($case);
     }
     return $type;
 }