Skip to content

Commit 1544f79

Browse files
authored
Merge pull request #1927 from amcastror/v2.4.x
Protected methods to be able to extend the listener
2 parents 5ea9846 + 9c94746 commit 1544f79

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/Gedmo/Sortable/SortableListener.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function postRemove(EventArgs $args)
155155
* @param ClassMetadata $meta
156156
* @param object $object
157157
*/
158-
private function processInsert(SortableAdapter $ea, array $config, $meta, $object)
158+
protected function processInsert(SortableAdapter $ea, array $config, $meta, $object)
159159
{
160160
$em = $ea->getObjectManager();
161161
$uow = $em->getUnitOfWork();
@@ -223,7 +223,7 @@ private function processInsert(SortableAdapter $ea, array $config, $meta, $objec
223223
* @param ClassMetadata $meta
224224
* @param object $object
225225
*/
226-
private function processUpdate(SortableAdapter $ea, array $config, $meta, $object)
226+
protected function processUpdate(SortableAdapter $ea, array $config, $meta, $object)
227227
{
228228
$em = $ea->getObjectManager();
229229
$uow = $em->getUnitOfWork();
@@ -363,7 +363,7 @@ private function processUpdate(SortableAdapter $ea, array $config, $meta, $objec
363363
* @param ClassMetadata $meta
364364
* @param object $object
365365
*/
366-
private function processDeletion(SortableAdapter $ea, array $config, $meta, $object)
366+
protected function processDeletion(SortableAdapter $ea, array $config, $meta, $object)
367367
{
368368
$position = $meta->getReflectionProperty($config['position'])->getValue($object);
369369

@@ -386,7 +386,7 @@ private function processDeletion(SortableAdapter $ea, array $config, $meta, $obj
386386
* Persists relocations to database.
387387
* @param SortableAdapter $ea
388388
*/
389-
private function persistRelocations(SortableAdapter $ea)
389+
protected function persistRelocations(SortableAdapter $ea)
390390
{
391391
if (!$this->persistenceNeeded) {
392392
return;
@@ -504,7 +504,7 @@ public function postFlush(EventArgs $args)
504504
}
505505
}
506506

507-
private function getHash($groups, array $config)
507+
protected function getHash($groups, array $config)
508508
{
509509
$data = $config['useObjectClass'];
510510
foreach ($groups as $group => $val) {
@@ -519,7 +519,7 @@ private function getHash($groups, array $config)
519519
return md5($data);
520520
}
521521

522-
private function getMaxPosition(SortableAdapter $ea, $meta, $config, $object, array $groups = array())
522+
protected function getMaxPosition(SortableAdapter $ea, $meta, $config, $object, array $groups = array())
523523
{
524524
$em = $ea->getObjectManager();
525525
$uow = $em->getUnitOfWork();
@@ -566,7 +566,7 @@ private function getMaxPosition(SortableAdapter $ea, $meta, $config, $object, ar
566566
* @param int $delta The delta to add to relocated nodes
567567
* @param array $exclude Objects to be excluded from relocation
568568
*/
569-
private function addRelocation($hash, $class, $groups, $start, $stop, $delta, array $exclude = array())
569+
protected function addRelocation($hash, $class, $groups, $start, $stop, $delta, array $exclude = array())
570570
{
571571
if (!array_key_exists($hash, $this->relocations)) {
572572
$this->relocations[$hash] = array('name' => $class, 'groups' => $groups, 'deltas' => array());
@@ -594,7 +594,7 @@ private function addRelocation($hash, $class, $groups, $start, $stop, $delta, ar
594594
*
595595
* @return array
596596
*/
597-
private function getGroups($meta, $config, $object)
597+
protected function getGroups($meta, $config, $object)
598598
{
599599
$groups = array();
600600
if (isset($config['groups'])) {

0 commit comments

Comments
 (0)