-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dispatch event to add search conditions (#12)
* added-event-dispatch-when-creating-query-conditions * DI * more-beautyfixes
- Loading branch information
1 parent
f5c4969
commit 67220d2
Showing
7 changed files
with
167 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea |
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,66 @@ | ||
<?php | ||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Enterprise License (PEL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PEL | ||
*/ | ||
|
||
namespace PimcoreHrefTypeaheadBundle\Event; | ||
|
||
use Pimcore\Model\DataObject; | ||
use Symfony\Component\EventDispatcher\Event; | ||
|
||
class HreftypeaheadSearchEvent extends Event | ||
{ | ||
/** @var DataObject\Conrete */ | ||
private $sourceObject; | ||
|
||
/** @var array */ | ||
private $conditions; | ||
|
||
/** | ||
* HreftypeaheadSearchEvent constructor. | ||
* | ||
* @param DataObject\Concrete $sourceObject | ||
* @param string[] $conditions | ||
*/ | ||
public function __construct(DataObject\Concrete $sourceObject, array &$conditions) | ||
{ | ||
$this->sourceObject = $sourceObject; | ||
$this->conditions = &$conditions; | ||
} | ||
|
||
/** | ||
* @return DataObject\Concrete | ||
*/ | ||
public function getSourceObject() | ||
{ | ||
return $this->sourceObject; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function getConditions() | ||
{ | ||
return $this->conditions; | ||
} | ||
|
||
public function setConditions(array $conditions) | ||
{ | ||
$this->conditions = $conditions; | ||
} | ||
|
||
public function addCondition($condition) | ||
{ | ||
$this->conditions[] = $condition; | ||
} | ||
|
||
} |
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