Skip to content

Instantly share code, notes, and snippets.

@lorenzo
Created November 17, 2015 15:48
Show Gist options
  • Save lorenzo/4a36e489df4683f46ee0 to your computer and use it in GitHub Desktop.
Save lorenzo/4a36e489df4683f46ee0 to your computer and use it in GitHub Desktop.
<?php
$date = new DateTime();
$someClass->findTimeFrame($date);
$otherClass->doStuff($date);
function findTimeFrame($fromDate) {
$this->conditions('from_date', '>=', $date);
...
}
// 3 months later... We need to restrict the time frame because REASONS
function findTimeFrame($fromDate) {
$this->conditions('from_date', '>=', $date);
$this->conditions('from_date', '<=', $date->modify('+1 week'));
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment