X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=vendor%2Fdoctrine%2Form%2Ftests%2FDoctrine%2FTests%2FModels%2FCMS%2FCmsAddress.php;fp=vendor%2Fdoctrine%2Form%2Ftests%2FDoctrine%2FTests%2FModels%2FCMS%2FCmsAddress.php;h=9833f3dfbc13c631bef27f39c6f453c8ea41656a;hb=8b04b2d11798dee4f3e1358e4f43e97a6df851f6;hp=0000000000000000000000000000000000000000;hpb=73568cf05a785a45f94ca3f2351d9e07bf917958;p=zf2.biz%2Fgalerie.git diff --git a/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsAddress.php b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsAddress.php new file mode 100644 index 0000000..9833f3d --- /dev/null +++ b/vendor/doctrine/orm/tests/Doctrine/Tests/Models/CMS/CmsAddress.php @@ -0,0 +1,191 @@ +id; + } + + public function getUser() { + return $this->user; + } + + public function getCountry() { + return $this->country; + } + + public function getZipCode() { + return $this->zip; + } + + public function getCity() { + return $this->city; + } + + public function setUser(CmsUser $user) { + if ($this->user !== $user) { + $this->user = $user; + $user->setAddress($this); + } + } + + public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata) + { + $metadata->setPrimaryTable(array( + 'name' => 'company_person', + )); + + $metadata->addNamedNativeQuery(array ( + 'name' => 'find-all', + 'query' => 'SELECT id, country, city FROM cms_addresses', + 'resultSetMapping' => 'mapping-find-all', + )); + + $metadata->addNamedNativeQuery(array ( + 'name' => 'find-by-id', + 'query' => 'SELECT * FROM cms_addresses WHERE id = ?', + 'resultClass' => 'Doctrine\\Tests\\Models\\CMS\\CmsAddress', + )); + + $metadata->addNamedNativeQuery(array ( + 'name' => 'count', + 'query' => 'SELECT COUNT(*) AS count FROM cms_addresses', + 'resultSetMapping' => 'mapping-count', + )); + + + $metadata->addSqlResultSetMapping(array ( + 'name' => 'mapping-find-all', + 'columns' => array(), + 'entities' => array ( array ( + 'fields' => array ( + array ( + 'name' => 'id', + 'column' => 'id', + ), + array ( + 'name' => 'city', + 'column' => 'city', + ), + array ( + 'name' => 'country', + 'column' => 'country', + ), + ), + 'entityClass' => 'Doctrine\Tests\Models\CMS\CmsAddress', + ), + ), + )); + + $metadata->addSqlResultSetMapping(array ( + 'name' => 'mapping-without-fields', + 'columns' => array(), + 'entities' => array(array ( + 'entityClass' => 'Doctrine\\Tests\\Models\\CMS\\CmsAddress', + 'fields' => array() + ) + ) + )); + + $metadata->addSqlResultSetMapping(array ( + 'name' => 'mapping-count', + 'columns' =>array ( + array ( + 'name' => 'count', + ), + ) + )); + } +} \ No newline at end of file