/** * * @param \DOMNode $xmlNode * @return \blaze\persistence\meta\ColumnDescriptor */ private function parseColumn(\DOMNode $xmlNode) { $column = new \blaze\persistence\meta\ColumnDescriptor(); $column->setName($xmlNode->getAttribute('name')); $column->setLength($xmlNode->getAttribute('length')); $column->setNullable($xmlNode->getAttribute('nullable')); return $column; }
private function makeOneToMany(\blaze\persistence\meta\ClassDescriptor $elem, $column, $ident) { $property = new \blaze\persistence\meta\CollectionFieldDescriptor(); $field = new \blaze\persistence\meta\SingleFieldDescriptor(); $property->setFieldDescriptor($field); $ident = $ident > 0 ? '' . $ident : ''; $field->setName($this->getMemberName($column->getTable()->getTableName() . 's' . $ident)); //$property->setInverse('true'); $col = new \blaze\persistence\meta\ColumnDescriptor(); $col->apply($column); $property->setColumnDescriptor($col); $property->setClassDescriptor(\blaze\persistence\meta\ClassDescriptor::getClassDescriptor($this->getClassName($column->getTable()->getTableName()))); $elem->addCollectionField($property); }