public function validateNoDateRangeOverlap($attribute, $params)
{
$pstart = 'start_date';
$pend = 'end_date';
foreach ($this->{$attribute} as $i => $dr) {
for ($j = $i + 1; $j < count($this->{$attribute}); ++$j) {
if ($dr->{$pstart} < $this->{$attribute}[$j]->{$pend} && $dr->{$pend} > $this->{$attribute}[$j]->{$pstart}) {
$this->addError($attribute, 'Data ranges cannot overlap');
}
}
}
}