Skip to content

Commit e7d61c2

Browse files
Fixes after rebase
1 parent d2ac5cc commit e7d61c2

File tree

49 files changed

+369
-478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+369
-478
lines changed

docs/en/cookbook/dql-custom-walkers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ implementation is:
130130
{
131131
$parent = null;
132132
$parentName = null;
133-
foreach ($this->_getQueryComponents() as $dqlAlias => $qComp) {
133+
foreach ($this->getQueryComponents() as $dqlAlias => $qComp) {
134134
if ($qComp['parent'] === null && $qComp['nestingLevel'] == 0) {
135135
$parent = $qComp;
136136
$parentName = $dqlAlias;

docs/en/reference/batch-processing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,13 @@ problems using the following approach:
168168
.. code-block:: php
169169
170170
<?php
171-
$q = $this->_em->createQuery('select u from MyProject\Model\User u');
171+
$q = $this->em->createQuery('select u from MyProject\Model\User u');
172172
$iterableResult = $q->iterate();
173173
foreach ($iterableResult as $row) {
174174
// do stuff with the data in the row, $row[0] is always the object
175175
176176
// detach all entities from Doctrine, so that Garbage-Collection can kick in immediately
177-
$this->_em->clear();
177+
$this->em->clear();
178178
}
179179
180180
.. note::

docs/en/reference/change-tracking-policies.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ follows:
8282
{
8383
// ...
8484
85-
private $_listeners = array();
85+
private $listeners = array();
8686
8787
public function addPropertyChangedListener(PropertyChangedListener $listener)
8888
{
89-
$this->_listeners[] = $listener;
89+
$this->listeners[] = $listener;
9090
}
9191
}
9292
@@ -104,10 +104,10 @@ behaviour:
104104
{
105105
// ...
106106
107-
protected function _onPropertyChanged($propName, $oldValue, $newValue)
107+
protected function onPropertyChanged($propName, $oldValue, $newValue)
108108
{
109-
if ($this->_listeners) {
110-
foreach ($this->_listeners as $listener) {
109+
if ($this->listeners) {
110+
foreach ($this->listeners as $listener) {
111111
$listener->propertyChanged($this, $propName, $oldValue, $newValue);
112112
}
113113
}
@@ -116,13 +116,13 @@ behaviour:
116116
public function setData($data)
117117
{
118118
if ($data != $this->data) {
119-
$this->_onPropertyChanged('data', $this->data, $data);
119+
$this->onPropertyChanged('data', $this->data, $data);
120120
$this->data = $data;
121121
}
122122
}
123123
}
124124
125-
You have to invoke ``_onPropertyChanged`` inside every method that
125+
You have to invoke ``onPropertyChanged`` inside every method that
126126
changes the persistent state of ``MyEntity``.
127127

128128
The check whether the new value is different from the old one is

docs/en/reference/dql-doctrine-query-language.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ creating a class which extends ``AbstractHydrator``:
12531253
{
12541254
protected function _hydrateAll()
12551255
{
1256-
return $this->_stmt->fetchAll(PDO::FETCH_ASSOC);
1256+
return $this->stmt->fetchAll(PDO::FETCH_ASSOC);
12571257
}
12581258
}
12591259

docs/en/reference/metadata-drivers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,22 +102,22 @@ the ``AbstractFileDriver`` implementation for you to extend from:
102102
/**
103103
* {@inheritdoc}
104104
*/
105-
protected $_fileExtension = '.dcm.ext';
105+
protected $fileExtension = '.dcm.ext';
106106
107107
/**
108108
* {@inheritdoc}
109109
*/
110110
public function loadMetadataForClass($className, ClassMetadata $metadata)
111111
{
112-
$data = $this->_loadMappingFile($file);
112+
$data = $this->loadMappingFile($file);
113113
114114
// populate ClassMetadata instance from $data
115115
}
116116
117117
/**
118118
* {@inheritdoc}
119119
*/
120-
protected function _loadMappingFile($file)
120+
protected function loadMappingFile($file)
121121
{
122122
// parse contents of $file and return php data structure
123123
}

docs/en/reference/native-sql.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ entity.
323323
$rsm->addFieldResult('u', 'id', 'id');
324324
$rsm->addFieldResult('u', 'name', 'name');
325325
326-
$query = $this->_em->createNativeQuery('SELECT id, name FROM users WHERE name = ?', $rsm);
326+
$query = $this->em->createNativeQuery('SELECT id, name FROM users WHERE name = ?', $rsm);
327327
$query->setParameter(1, 'romanb');
328328
329329
$users = $query->getResult();
@@ -359,7 +359,7 @@ thus owns the foreign key.
359359
$rsm->addFieldResult('u', 'name', 'name');
360360
$rsm->addMetaResult('u', 'address_id', 'address_id');
361361
362-
$query = $this->_em->createNativeQuery('SELECT id, name, address_id FROM users WHERE name = ?', $rsm);
362+
$query = $this->em->createNativeQuery('SELECT id, name, address_id FROM users WHERE name = ?', $rsm);
363363
$query->setParameter(1, 'romanb');
364364
365365
$users = $query->getResult();
@@ -390,7 +390,7 @@ associations that are lazy.
390390
391391
$sql = 'SELECT u.id, u.name, a.id AS address_id, a.street, a.city FROM users u ' .
392392
'INNER JOIN address a ON u.address_id = a.id WHERE u.name = ?';
393-
$query = $this->_em->createNativeQuery($sql, $rsm);
393+
$query = $this->em->createNativeQuery($sql, $rsm);
394394
$query->setParameter(1, 'romanb');
395395
396396
$users = $query->getResult();
@@ -423,7 +423,7 @@ to map the hierarchy (both use a discriminator column).
423423
$rsm->addMetaResult('u', 'discr', 'discr'); // discriminator column
424424
$rsm->setDiscriminatorColumn('u', 'discr');
425425
426-
$query = $this->_em->createNativeQuery('SELECT id, name, discr FROM users WHERE name = ?', $rsm);
426+
$query = $this->em->createNativeQuery('SELECT id, name, discr FROM users WHERE name = ?', $rsm);
427427
$query->setParameter(1, 'romanb');
428428
429429
$users = $query->getResult();

docs/en/reference/second-level-cache.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ Execute the ``UPDATE`` and invalidate ``all cache entries`` using ``Query::HINT_
590590
591591
<?php
592592
// Execute and invalidate
593-
$this->_em->createQuery("UPDATE Entity\Country u SET u.name = 'unknown' WHERE u.id = 1")
593+
$this->em->createQuery("UPDATE Entity\Country u SET u.name = 'unknown' WHERE u.id = 1")
594594
->setHint(Query::HINT_CACHE_EVICT, true)
595595
->execute();
596596
@@ -601,7 +601,7 @@ Execute the ``UPDATE`` and invalidate ``all cache entries`` using the cache API
601601
602602
<?php
603603
// Execute
604-
$this->_em->createQuery("UPDATE Entity\Country u SET u.name = 'unknown' WHERE u.id = 1")
604+
$this->em->createQuery("UPDATE Entity\Country u SET u.name = 'unknown' WHERE u.id = 1")
605605
->execute();
606606
// Invoke Cache API
607607
$em->getCache()->evictEntityRegion('Entity\Country');
@@ -613,7 +613,7 @@ Execute the ``UPDATE`` and invalidate ``a specific cache entry`` using the cache
613613
614614
<?php
615615
// Execute
616-
$this->_em->createQuery("UPDATE Entity\Country u SET u.name = 'unknown' WHERE u.id = 1")
616+
$this->em->createQuery("UPDATE Entity\Country u SET u.name = 'unknown' WHERE u.id = 1")
617617
->execute();
618618
// Invoke Cache API
619619
$em->getCache()->evictEntity('Entity\Country', 1);

docs/en/reference/working-with-objects.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ in a central location.
749749
{
750750
public function getAllAdminUsers()
751751
{
752-
return $this->_em->createQuery('SELECT u FROM MyDomain\Model\User u WHERE u.status = "admin"')
752+
return $this->em->createQuery('SELECT u FROM MyDomain\Model\User u WHERE u.status = "admin"')
753753
->getResult();
754754
}
755755
}

lib/Doctrine/ORM/EntityManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public function transactional(callable $func)
229229
$this->flush();
230230
$this->conn->commit();
231231

232-
return $return ?: true;
232+
return $return;
233233
} catch (\Throwable $e) {
234234
$this->close();
235235
$this->conn->rollBack();

lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function hydrateAll($stmt, $resultSetMapping, array $hints = [])
126126
$this->rsm = $resultSetMapping;
127127
$this->hints = $hints;
128128

129-
$this->_em->getEventManager()->addEventListener([Events::onClear], $this);
129+
$this->em->getEventManager()->addEventListener([Events::onClear], $this);
130130

131131
$this->prepare();
132132

@@ -379,7 +379,7 @@ protected function hydrateColumnInfo($key)
379379

380380
// the current discriminator value must be saved in order to disambiguate fields hydration,
381381
// should there be field name collisions
382-
if ($classMetadata->parentClasses && isset($this->rsm->discriminatorColumns[$ownerMap])) {
382+
if ($classMetadata->getParent() && isset($this->rsm->discriminatorColumns[$ownerMap])) {
383383
return $this->cache[$key] = \array_merge(
384384
$columnInfo,
385385
[

0 commit comments

Comments
 (0)