-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from szymach/2.2
Added events when moving up or down
- Loading branch information
Showing
8 changed files
with
224 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
/** | ||
* (c) FSi sp. z o.o. <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace FSi\Bundle\AdminTreeBundle\Event; | ||
|
||
use FSi\Bundle\AdminBundle\Admin\Element; | ||
use FSi\Bundle\AdminBundle\Event\AdminEvent; | ||
use InvalidArgumentException; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
final class MovedDownTreeEvent extends AdminEvent | ||
{ | ||
/** | ||
* @var object | ||
*/ | ||
private $entity; | ||
|
||
/** | ||
* @param Element $element | ||
* @param Request $request | ||
* @param mixed $entity | ||
* @throws InvalidArgumentException | ||
*/ | ||
public function __construct(Element $element, Request $request, $entity) | ||
{ | ||
if (false === is_object($entity)) { | ||
throw new InvalidArgumentException(sprintf( | ||
'Expected an object, got "%s" instead', | ||
gettype($entity) | ||
)); | ||
} | ||
|
||
parent::__construct($element, $request); | ||
$this->entity = $entity; | ||
} | ||
|
||
/** | ||
* @return object | ||
*/ | ||
public function getEntity() | ||
{ | ||
return $this->entity; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
/** | ||
* (c) FSi sp. z o.o. <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace FSi\Bundle\AdminTreeBundle\Event; | ||
|
||
use FSi\Bundle\AdminBundle\Admin\Element; | ||
use FSi\Bundle\AdminBundle\Event\AdminEvent; | ||
use InvalidArgumentException; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use function gettype; | ||
use function is_object; | ||
|
||
final class MovedUpTreeEvent extends AdminEvent | ||
{ | ||
/** | ||
* @var object | ||
*/ | ||
private $entity; | ||
|
||
/** | ||
* @param Element $element | ||
* @param Request $request | ||
* @param mixed $entity | ||
* @throws InvalidArgumentException | ||
*/ | ||
public function __construct(Element $element, Request $request, $entity) | ||
{ | ||
if (false === is_object($entity)) { | ||
throw new InvalidArgumentException(sprintf( | ||
'Expected an object, got "%s" instead', | ||
gettype($entity) | ||
)); | ||
} | ||
|
||
parent::__construct($element, $request); | ||
$this->entity = $entity; | ||
} | ||
|
||
/** | ||
* @return object | ||
*/ | ||
public function getEntity() | ||
{ | ||
return $this->entity; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters