@@ -35,7 +35,7 @@ |
||
| 35 | 35 | $this->_em->flush(); |
| 36 | 36 | |
| 37 | 37 | $query = $this->_em->createQuery('SELECT f, fl FROM Doctrine\Tests\ORM\Functional\Ticket\DDC1300Foo f JOIN f._fooLocaleRefFoo fl'); |
| 38 | - $result = $query->getResult(); |
|
| 38 | + $result = $query->getResult(); |
|
| 39 | 39 | |
| 40 | 40 | $this->assertEquals(1, count($result)); |
| 41 | 41 | } |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | $user1 = $this->_em->getReference(DDC1400User::class, $user1->id); |
| 55 | 55 | |
| 56 | 56 | $this->_em->createQuery('SELECT a, s FROM ' . DDC1400Article::class . ' a JOIN a.userStates s WITH s.user = :activeUser') |
| 57 | - ->setParameter('activeUser', $user1) |
|
| 58 | - ->getResult(); |
|
| 57 | + ->setParameter('activeUser', $user1) |
|
| 58 | + ->getResult(); |
|
| 59 | 59 | |
| 60 | 60 | $queryCount = $this->getCurrentQueryCount(); |
| 61 | 61 | |
@@ -109,13 +109,13 @@ discard block |
||
| 109 | 109 | { |
| 110 | 110 | |
| 111 | 111 | /** |
| 112 | - * @Id |
|
| 112 | + * @Id |
|
| 113 | 113 | * @ManyToOne(targetEntity="DDC1400Article", inversedBy="userStates") |
| 114 | 114 | */ |
| 115 | 115 | public $article; |
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | - * @Id |
|
| 118 | + * @Id |
|
| 119 | 119 | * @ManyToOne(targetEntity="DDC1400User", inversedBy="userStates") |
| 120 | 120 | */ |
| 121 | 121 | public $user; |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | |
| 54 | 54 | $user1 = $this->_em->getReference(DDC1400User::class, $user1->id); |
| 55 | 55 | |
| 56 | - $this->_em->createQuery('SELECT a, s FROM ' . DDC1400Article::class . ' a JOIN a.userStates s WITH s.user = :activeUser') |
|
| 56 | + $this->_em->createQuery('SELECT a, s FROM '.DDC1400Article::class.' a JOIN a.userStates s WITH s.user = :activeUser') |
|
| 57 | 57 | ->setParameter('activeUser', $user1) |
| 58 | 58 | ->getResult(); |
| 59 | 59 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | $this->addresses = $addresses; |
| 164 | 164 | |
| 165 | - $addresses->map(function ($address) use ($self) { |
|
| 165 | + $addresses->map(function($address) use ($self) { |
|
| 166 | 166 | $address->user = $self; |
| 167 | 167 | }); |
| 168 | 168 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | $this->pets = $pets; |
| 175 | 175 | |
| 176 | - $pets->map(function ($pet) use ($self) { |
|
| 176 | + $pets->map(function($pet) use ($self) { |
|
| 177 | 177 | $pet->owner = $self; |
| 178 | 178 | }); |
| 179 | 179 | } |
@@ -80,14 +80,14 @@ |
||
| 80 | 80 | $this->_em->clear(); |
| 81 | 81 | |
| 82 | 82 | // fetch-join that foreign-key/primary-key entity association |
| 83 | - $dql = "SELECT c, p FROM " . DDC881PhoneCall::class . " c JOIN c.phonenumber p"; |
|
| 83 | + $dql = "SELECT c, p FROM ".DDC881PhoneCall::class." c JOIN c.phonenumber p"; |
|
| 84 | 84 | $calls = $this->_em->createQuery($dql)->getResult(); |
| 85 | 85 | |
| 86 | 86 | $this->assertEquals(2, count($calls)); |
| 87 | 87 | $this->assertNotInstanceOf(Proxy::class, $calls[0]->getPhoneNumber()); |
| 88 | 88 | $this->assertNotInstanceOf(Proxy::class, $calls[1]->getPhoneNumber()); |
| 89 | 89 | |
| 90 | - $dql = "SELECT p, c FROM " . DDC881PhoneNumber::class . " p JOIN p.calls c"; |
|
| 90 | + $dql = "SELECT p, c FROM ".DDC881PhoneNumber::class." p JOIN p.calls c"; |
|
| 91 | 91 | $numbers = $this->_em->createQuery($dql)->getResult(); |
| 92 | 92 | |
| 93 | 93 | $this->assertEquals(2, count($numbers)); |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * @Entity |
| 74 | - */ |
|
| 74 | + */ |
|
| 75 | 75 | class DDC512OfferItem extends DDC512Item |
| 76 | 76 | { |
| 77 | 77 | } |
@@ -35,19 +35,19 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | $dql = "SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.user = :author"; |
| 37 | 37 | $this->_em->createQuery($dql) |
| 38 | - ->setParameter('author', $user) |
|
| 39 | - ->getResult(); |
|
| 38 | + ->setParameter('author', $user) |
|
| 39 | + ->getResult(); |
|
| 40 | 40 | |
| 41 | 41 | $dql = "SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.user = :author AND a.user = :author"; |
| 42 | 42 | $this->_em->createQuery($dql) |
| 43 | - ->setParameter('author', $user) |
|
| 44 | - ->getResult(); |
|
| 43 | + ->setParameter('author', $user) |
|
| 44 | + ->getResult(); |
|
| 45 | 45 | |
| 46 | 46 | $dql = "SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.topic = :topic AND a.user = :author AND a.user = :author"; |
| 47 | 47 | $farticle = $this->_em->createQuery($dql) |
| 48 | - ->setParameter('author', $user) |
|
| 49 | - ->setParameter('topic', 'This is John Galt speaking!') |
|
| 50 | - ->getSingleResult(); |
|
| 48 | + ->setParameter('author', $user) |
|
| 49 | + ->setParameter('topic', 'This is John Galt speaking!') |
|
| 50 | + ->getSingleResult(); |
|
| 51 | 51 | |
| 52 | 52 | $this->assertSame($article, $farticle); |
| 53 | 53 | } |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | $dql = "SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.topic = ?1 AND a.user = ?2 AND a.user = ?3"; |
| 72 | 72 | $farticle = $this->_em->createQuery($dql) |
| 73 | - ->setParameter(1, 'This is John Galt speaking!') |
|
| 74 | - ->setParameter(2, $user) |
|
| 75 | - ->setParameter(3, $user) |
|
| 76 | - ->getSingleResult(); |
|
| 73 | + ->setParameter(1, 'This is John Galt speaking!') |
|
| 74 | + ->setParameter(2, $user) |
|
| 75 | + ->setParameter(3, $user) |
|
| 76 | + ->getSingleResult(); |
|
| 77 | 77 | |
| 78 | 78 | $this->assertSame($article, $farticle); |
| 79 | 79 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | $this->_em->getClassMetadata(DDC1655Baz::class), |
| 22 | 22 | ] |
| 23 | 23 | ); |
| 24 | - } catch(\Exception $e) { |
|
| 24 | + } catch (\Exception $e) { |
|
| 25 | 25 | } |
| 26 | 26 | } |
| 27 | 27 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $baz = $this->_em->find(get_class($baz), $baz->id); |
| 49 | 49 | foreach ($baz->foos as $foo) { |
| 50 | - $this->assertEquals(1, $foo->loaded, "should have loaded callback counter incremented for " . get_class($foo)); |
|
| 50 | + $this->assertEquals(1, $foo->loaded, "should have loaded callback counter incremented for ".get_class($foo)); |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $this->assertEquals(1, $bar->loaded); |
| 72 | 72 | $this->assertEquals(1, $bar->subLoaded); |
| 73 | 73 | |
| 74 | - $dql = "SELECT b FROM " . __NAMESPACE__ . "\DDC1655Bar b WHERE b.id = ?1"; |
|
| 74 | + $dql = "SELECT b FROM ".__NAMESPACE__."\DDC1655Bar b WHERE b.id = ?1"; |
|
| 75 | 75 | $bar = $this->_em->createQuery($dql)->setParameter(1, $bar->id)->getSingleResult(); |
| 76 | 76 | |
| 77 | 77 | $this->assertEquals(1, $bar->loaded); |
@@ -50,65 +50,65 @@ |
||
| 50 | 50 | /** @Column(type="string", nullable=false) */ |
| 51 | 51 | protected $name; |
| 52 | 52 | |
| 53 | - /** @Column(type="string", nullable=true) */ |
|
| 54 | - protected $description; |
|
| 55 | - |
|
| 56 | - /** |
|
| 57 | - * @ManyToMany(targetEntity="DDC719Group", inversedBy="parents") |
|
| 58 | - * @JoinTable(name="groups_groups", |
|
| 59 | - * joinColumns={@JoinColumn(name="parent_id", referencedColumnName="id")}, |
|
| 60 | - * inverseJoinColumns={@JoinColumn(name="child_id", referencedColumnName="id")} |
|
| 61 | - * ) |
|
| 62 | - */ |
|
| 63 | - protected $children = NULL; |
|
| 64 | - |
|
| 65 | - /** |
|
| 66 | - * @ManyToMany(targetEntity="DDC719Group", mappedBy="children") |
|
| 67 | - */ |
|
| 68 | - protected $parents = NULL; |
|
| 69 | - |
|
| 70 | - /** |
|
| 71 | - * construct |
|
| 72 | - */ |
|
| 73 | - public function __construct() { |
|
| 74 | - parent::__construct(); |
|
| 75 | - |
|
| 76 | - $this->channels = new ArrayCollection(); |
|
| 77 | - $this->children = new ArrayCollection(); |
|
| 78 | - $this->parents = new ArrayCollection(); |
|
| 79 | - } |
|
| 80 | - |
|
| 81 | - /** |
|
| 82 | - * adds group as new child |
|
| 83 | - * |
|
| 84 | - * @param Group $child |
|
| 85 | - */ |
|
| 86 | - public function addGroup(Group $child) { |
|
| 53 | + /** @Column(type="string", nullable=true) */ |
|
| 54 | + protected $description; |
|
| 55 | + |
|
| 56 | + /** |
|
| 57 | + * @ManyToMany(targetEntity="DDC719Group", inversedBy="parents") |
|
| 58 | + * @JoinTable(name="groups_groups", |
|
| 59 | + * joinColumns={@JoinColumn(name="parent_id", referencedColumnName="id")}, |
|
| 60 | + * inverseJoinColumns={@JoinColumn(name="child_id", referencedColumnName="id")} |
|
| 61 | + * ) |
|
| 62 | + */ |
|
| 63 | + protected $children = NULL; |
|
| 64 | + |
|
| 65 | + /** |
|
| 66 | + * @ManyToMany(targetEntity="DDC719Group", mappedBy="children") |
|
| 67 | + */ |
|
| 68 | + protected $parents = NULL; |
|
| 69 | + |
|
| 70 | + /** |
|
| 71 | + * construct |
|
| 72 | + */ |
|
| 73 | + public function __construct() { |
|
| 74 | + parent::__construct(); |
|
| 75 | + |
|
| 76 | + $this->channels = new ArrayCollection(); |
|
| 77 | + $this->children = new ArrayCollection(); |
|
| 78 | + $this->parents = new ArrayCollection(); |
|
| 79 | + } |
|
| 80 | + |
|
| 81 | + /** |
|
| 82 | + * adds group as new child |
|
| 83 | + * |
|
| 84 | + * @param Group $child |
|
| 85 | + */ |
|
| 86 | + public function addGroup(Group $child) { |
|
| 87 | 87 | if ( ! $this->children->contains($child)) { |
| 88 | 88 | $this->children->add($child); |
| 89 | 89 | $child->addGroup($this); |
| 90 | 90 | } |
| 91 | - } |
|
| 92 | - |
|
| 93 | - /** |
|
| 94 | - * adds channel as new child |
|
| 95 | - * |
|
| 96 | - * @param Channel $child |
|
| 97 | - */ |
|
| 98 | - public function addChannel(Channel $child) { |
|
| 91 | + } |
|
| 92 | + |
|
| 93 | + /** |
|
| 94 | + * adds channel as new child |
|
| 95 | + * |
|
| 96 | + * @param Channel $child |
|
| 97 | + */ |
|
| 98 | + public function addChannel(Channel $child) { |
|
| 99 | 99 | if ( ! $this->channels->contains($child)) { |
| 100 | 100 | $this->channels->add($child); |
| 101 | 101 | } |
| 102 | - } |
|
| 103 | - |
|
| 104 | - /** |
|
| 105 | - * getter & setter |
|
| 106 | - */ |
|
| 107 | - public function getName() { return $this->name; } |
|
| 108 | - public function setName($name) { $this->name = $name; } |
|
| 109 | - public function getDescription() { return $this->description; } |
|
| 110 | - public function setDescription($description) { $this->description = $description; } |
|
| 111 | - public function getChildren() { return $this->children; } |
|
| 112 | - public function getParents() { return $this->parents; } |
|
| 113 | - public function getChannels() { return $this->channels; } |
|
| 102 | + } |
|
| 103 | + |
|
| 104 | + /** |
|
| 105 | + * getter & setter |
|
| 106 | + */ |
|
| 107 | + public function getName() { return $this->name; } |
|
| 108 | + public function setName($name) { $this->name = $name; } |
|
| 109 | + public function getDescription() { return $this->description; } |
|
| 110 | + public function setDescription($description) { $this->description = $description; } |
|
| 111 | + public function getChildren() { return $this->children; } |
|
| 112 | + public function getParents() { return $this->parents; } |
|
| 113 | + public function getChannels() { return $this->channels; } |
|
| 114 | 114 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | |
| 28 | 28 | $employee = new Issue5989Employee(); |
| 29 | 29 | |
| 30 | - $employeeTags =['tag2', 'tag3']; |
|
| 30 | + $employeeTags = ['tag2', 'tag3']; |
|
| 31 | 31 | $employee->tags = $employeeTags; |
| 32 | 32 | $this->_em->persist($employee); |
| 33 | 33 | |