Skip to content

Instantly share code, notes, and snippets.

@avit
Created February 8, 2012 23:58
Show Gist options
  • Save avit/1775608 to your computer and use it in GitHub Desktop.
Save avit/1775608 to your computer and use it in GitHub Desktop.
How to get Event Adapter from a repository?
class SchedulableListener extends MappedEventSubscriber
{
// ...
public function getRecurrenceRuleClass(SchedulableAdapter $ea, $class)
{
return isset($this->configurations['schedulable']['recurrenceRuleClass']) ?
$this->configurations['schedulable']['recurrenceRuleClass'] :
$ea->getDefaultRecurrenceRuleClass();
}
}
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