-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new event to make sure node info can be altered before it is pers…
…isted to the database.
- Loading branch information
Showing
2 changed files
with
62 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
/** | ||
* This file is part of the Clastic package. | ||
* | ||
* (c) Dries De Peuter <dries@nousefreak.be> | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Clastic\NodeBundle\Event; | ||
|
||
use Clastic\NodeBundle\Entity\Node; | ||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\Form\Form; | ||
|
||
/** | ||
* @author Dries De Peuter <dries@nousefreak.be> | ||
*/ | ||
class NodeFormPrePersistEvent extends Event | ||
{ | ||
const NODE_FORM_PREPERSIST = 'clastic.node.form.prepersist'; | ||
|
||
/** | ||
* @var Node | ||
*/ | ||
private $node; | ||
|
||
/** | ||
* @var Form | ||
*/ | ||
private $form; | ||
|
||
/** | ||
* @param Node $node | ||
* @param Form $form | ||
*/ | ||
public function __construct(Node $node, Form $form) | ||
{ | ||
$this->node = $node; | ||
$this->form = $form; | ||
} | ||
|
||
/** | ||
* @return Node | ||
*/ | ||
public function getNode() | ||
{ | ||
return $this->node; | ||
} | ||
|
||
/** | ||
* @return Form | ||
*/ | ||
public function getForm() | ||
{ | ||
return $this->form; | ||
} | ||
} |