Exemple #1
0
 /**
  * Returns case field-descriptor for given general metadata.
  *
  * @param GeneralPropertyMetadata $generalMetadata
  * @param CaseTypeMetadata $type
  * @param array $options
  *
  * @return DoctrineCaseFieldDescriptor
  */
 private function getCaseFieldDescriptor(GeneralPropertyMetadata $generalMetadata, CaseTypeMetadata $type, $options)
 {
     $case1 = $type->getCase(0);
     $case2 = $type->getCase(1);
     return new DoctrineCaseFieldDescriptor($this->resolveOptions($generalMetadata->getName(), $options), new DoctrineDescriptor($case1->getEntityName(), $case1->getName(), $this->getDoctrineJoins($case1->getJoins(), $options)), new DoctrineDescriptor($case2->getEntityName(), $case2->getName(), $this->getDoctrineJoins($case2->getJoins(), $options)), $generalMetadata->getTranslation(), $this->isDisabled($generalMetadata), $this->isDefault($generalMetadata), $generalMetadata->getType(), $generalMetadata->getWidth(), $generalMetadata->getMinWidth(), $generalMetadata->isSortable(), $generalMetadata->isEditable(), $generalMetadata->getCssClass());
 }
Exemple #2
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;
 }