Browse files

cleaned up merge - solved some merging conflicts - needs investigation

  • Loading branch information...
1 parent 146b0a2 commit 5c5df04b21a61c1c7d8f05db3e409d831ca0e58a @johmue johmue committed May 15, 2012
View
1 .gitignore
@@ -6,3 +6,4 @@ tests/
.settings/
*.zip
*.sh
+*.7z
View
2 example/doctrine2.annotation.php
@@ -41,7 +41,7 @@
// formatter setup
$setup = array(
- Formatter::CFG_USE_LOGGED_STORAGE => true,
+ Formatter::CFG_USE_LOGGED_STORAGE => true,
Formatter::CFG_INDENTATION => 4,
Formatter::CFG_FILENAME => '%entity%.%extension%',
Formatter::CFG_ANNOTATION_PREFIX => 'ORM\\',
View
39 lib/MwbExporter/Formatter/Doctrine2/Annotation/Model/Table.php
@@ -94,28 +94,8 @@ public function getCollectionClass($useFQCN = true)
*/
public function getCollectionInterface($absolute = true)
{
-<<<<<<< HEAD
- $return = array();
- $config = Registry::get('config');
- $this->ormPrefix = '@' . ((isset($config['useAnnotationPrefix']) && $config['useAnnotationPrefix']) ? $config['useAnnotationPrefix'] : '');
- $namespace = $this->getEntityNamespace();
- $repositoryNamespace = isset($config['repositoryNamespace']) && $config['repositoryNamespace'] ? $config['repositoryNamespace'] . '\\' : '';
- $skipGetterAndSetter = isset($config['skipGetterAndSetter']) && $config['skipGetterAndSetter'] ? true : false;
- // indices
- $indices = array();
- $uniqueIndices = array();
- foreach($this->indexes as $index){
- if($index->isIndex()){
- $indices[] = $this->ormPrefix . 'Index(' . $index->display() . ')';
- }
- if ($index->isUnique()){
- $uniqueIndices[] = $this->ormPrefix . 'UniqueConstraint(' . $index->display() . ')';
- }
- }
-=======
return ($absolute ? '\\' : '').$this->collectionInterface;
}
->>>>>>> f5e4c3ae74bd8b331054b3f10a6334978076655b
/**
* Write document as generated code.
@@ -131,22 +111,6 @@ public function write(WriterInterface $writer)
$writer->close();
}
-<<<<<<< HEAD
- $return[] = '/**';
- $return[] = ' * ' . $this->getNamespace();
- $return[] = ' *';
- $return[] = ' * ' . $this->ormPrefix . 'Entity' . (isset($config['useAutomaticRepository']) && $config['useAutomaticRepository'] ? sprintf('(repositoryClass="%sRepository")', $repositoryNamespace . $this->getModelName()) : '');
- $return[] = ' * ' . $this->ormPrefix . 'Table(name="' . $this->getRawTableName() . '"' . (count($indices) ? ', indexes={' . implode(', ', $indices) . '}' : '') . (count($uniqueIndices) ? ', uniqueConstraints={' . implode(', ', $uniqueIndices) . '}' : '') . ')';
- $return[] = ' */';
- $return[] = 'class ' . $this->getModelName();
- $return[] = '{';
- $return[] = $this->columns->display();
- $return[] = $this->displayManyToMany();
- $return[] = $this->displayConstructor();
- if (!$skipGetterAndSetter) {
- $return[] = $this->columns->displayGetterAndSetter();
- $return[] = $this->displayManyToManyGetterAndSetter();
-=======
return $this;
}
/**
@@ -159,7 +123,6 @@ public function addPrefix($annotation = null)
{
if (null === $this->ormPrefix) {
$this->ormPrefix = '@'.$this->getDocument()->getConfig()->get(Formatter::CFG_ANNOTATION_PREFIX);
->>>>>>> f5e4c3ae74bd8b331054b3f10a6334978076655b
}
return $this->ormPrefix.($annotation ? $annotation : '');
@@ -336,4 +299,4 @@ public function writeManyToManyGetterAndSetter(WriterInterface $writer)
return $this;
}
-}
+}
View
55 lib/MwbExporter/Formatter/Zend/DbTable/Model/ForeignKey.php
@@ -34,60 +34,6 @@ class ForeignKey extends BaseForeignKey
{
public function write(WriterInterface $writer)
{
-<<<<<<< HEAD
- parent::__construct($data, $parent);
-
- $referencedColumn = $this->data->xpath("value[@key='referencedColumns']");
- $local = Registry::get((string) $referencedColumn[0]->link);
-
- $ownerColumn = $this->data->xpath("value[@key='columns']");
- $foreign = Registry::get((string) $ownerColumn[0]->link);
-
- $this->local = $local; // local column object
- $this->foreign = $foreign; // foreign column object
-
- // for doctrine2 annotations switch the local and the foreign
- // reference for a proper output
- $local->markAsForeignReference($this);
- $foreign->markAsLocalReference($this);
-
- // many to many
- if($fk = $this->getOwningTable()->getForeignKeys()){
- // only two or more foreign keys implicate an m2m relation
- // of the current table
- if(count($fk) > 1){
- foreach($fk as $foreignKey1){
- foreach($fk as $foreignKey2){
- if($foreignKey1->getReferencedTable()->getId() != $foreignKey2->getReferencedTable()->getId()){
- $foreignKey1->getReferencedTable()->setManyToManyRelation(
- array(
- 'reference' => $this,
- 'refTable' => $foreignKey2->getReferencedTable()
- )
- );
- }
- }
- }
- }
- }
- }
-
- /**
- *
- * @return string
- */
- public function display()
- {
- $return = array();
-
- $return[] = $this->indentation(3) .'\''. $this->getReferencedTable()->getRawTableName() .'\' => array(';
- $return[] = $this->indentation(4) .'\'columns\' => \''. $this->foreign->getColumnName() .'\',';
- $return[] = $this->indentation(4) .'\'refTableClass\' => \''. $this->getReferencedTable()->getTableClassName() .'\',';
- $return[] = $this->indentation(4) .'\'refColumns\' => \''. $this->local->getColumnName() .'\',';
- $return[] = $this->indentation(3) .'),';
-
- return implode("\n", $return);
-=======
$writer
->write('\''. $this->getReferencedTable()->getRawTableName() .'\' => array(')
->indent()
@@ -99,6 +45,5 @@ public function display()
;
return $this;
->>>>>>> f5e4c3ae74bd8b331054b3f10a6334978076655b
}
}
View
104 lib/MwbExporter/Formatter/Zend/DbTable/Model/Table.php
@@ -40,56 +40,6 @@ public function getTablePrefix()
public function getParentTable()
{
-<<<<<<< HEAD
- $config = Registry::get('config');
-
- $return = array();
-
- $return[] = '<?php';
- $return[] = '';
- $return[] = '/**';
- $return[] = ' * ';
- $return[] = ' */';
-
- /* FIXME: [Zend] Table name is one time in singular form, one time in plural form.
- * All table occurence need to be at the original form.
- *
- * $this->getModelName() return singular form with correct camel case
- * $this->getRawTableName() return original form with no camel case
- */
- $return[] = 'class ' . $this->getTableClassName() . ' extends ' . $this->parentTable;
- $return[] = '{';
-
- if (true === $config['generateSchema']) {
- $return[] = $this->indentation(1) .'/* @var string $_schema */';
- $return[] = $this->indentation(1) .'protected $_schema = \''. $this->getSchemaName() .'\';';
- $return[] = '';
- }
-
- if (true === $config['generateName']) {
- $return[] = $this->indentation(1) .'/* @var string $_name */';
- $return[] = $this->indentation(1) .'protected $_name = \''. $this->getRawTableName() .'\';';
- $return[] = '';
- }
-
- if (true === $config['generatePrimary']){
- $return[] = $this->displayPrimary();
- $return[] = '';
- }
-
- if (true === $config['generateDRI']) {
- $return[] = $this->displayDependencies();
- $return[] = '';
- }
-
- if (true === $config['generateReferences']) {
- $return[] = $this->displayReferences();
- $return[] = '';
- }
-
- $return[] = '}';
- return implode("\n", $return);
-=======
return $this->translateVars($this->getDocument()->getConfig()->get(Formatter::CFG_PARENT_TABLE));
}
@@ -100,7 +50,6 @@ public function write(WriterInterface $writer)
$this->writeTable($writer);
$writer->close();
}
->>>>>>> f5e4c3ae74bd8b331054b3f10a6334978076655b
}
public function writeTable(WriterInterface $writer)
@@ -146,21 +95,6 @@ public function writeTable(WriterInterface $writer)
public function writeDependencies(WriterInterface $writer)
{
//TODO: [Zend] Find a way to print dependance without change the core.
-<<<<<<< HEAD
- $return = array();
-
-// $dependentTables = $this->getRelationToTable('users');
-// var_dump($this->getRawTableName());
-// var_dump(count($dependentTables));
-// var_dump($dependentTables);
-
- $return[] = $this->indentation(1) .'/* Note: this feature isn\'t implement yet */';
-
- $return[] = $this->indentation(1) .'/* @var array $_dependentTables */';
- $return[] = $this->indentation(1) .'protected $_dependentTables = array();';
-
- return implode("\n", $return);
-=======
$writer
->write('/**')
->write(' * TODO: this feature isn\'t implement yet')
@@ -172,42 +106,10 @@ public function writeDependencies(WriterInterface $writer)
;
return $this;
->>>>>>> f5e4c3ae74bd8b331054b3f10a6334978076655b
}
public function writeReferences(WriterInterface $writer)
{
-<<<<<<< HEAD
- $return = array();
-
- $return[] = $this->indentation(1) .'/* @var array $_referenceMap */';
-
- if (count($this->getForeignKeys()) > 0) {
- $return[] = $this->indentation(1) .'protected $_referenceMap = array(';
-
- foreach($this->getForeignKeys() as $foreignKey){
- $return[] = $foreignKey->display();
- }
-
- $return[] = $this->indentation(1) .');';
- } else {
- $return[] = $this->indentation(1) .'protected $_referenceMap = array();';
- }
- return implode("\n", $return);
- }
-
- /**
- *
- * @return string
- */
- protected function displayPrimary()
- {
- $return = array();
- $return[] = $this->indentation(1) .'/* @var array $_primary */';
- $return[] = $this->indentation(1) .'protected $_primary = array('.$this->getColumns()->displayPrimary().');';
-
- return implode("\n", $return);
-=======
$writer
->write('/**')
->write(' * @var array')
@@ -228,11 +130,5 @@ protected function displayPrimary()
;
return $this;
->>>>>>> f5e4c3ae74bd8b331054b3f10a6334978076655b
- }
-
- public function getTableClassName()
- {
- return $this->tablePrefix . $this->getSchemaName() .'_'. $this->getModelName();
}
}

1 comment on commit 5c5df04

@johmue

Git did not say anything about unsolved merging conflicts and commited straight away! WTF?

Please sign in to comment.