Created
February 8, 2012 23:58
-
-
Save avit/1775608 to your computer and use it in GitHub Desktop.
How to get Event Adapter from a repository?
This file contains hidden or 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
class SchedulableListener extends MappedEventSubscriber | |
{ | |
// ... | |
public function getRecurrenceRuleClass(SchedulableAdapter $ea, $class) | |
{ | |
return isset($this->configurations['schedulable']['recurrenceRuleClass']) ? | |
$this->configurations['schedulable']['recurrenceRuleClass'] : | |
$ea->getDefaultRecurrenceRuleClass(); | |
} | |
} |
This file contains hidden or 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
class SchedulableRepository extends EntityRepository | |
{ | |
public function findInDateRange($startDate, $endDate) | |
{ | |
$objectMeta = $this->getClassMetadata(); | |
$ea = // How do I access the Adapter here? (BaseAdapterORM) | |
$ruleClass = $listener->getRecurrenceRuleClass($ea, $objectMeta->name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment