One right bracket is missing?
return $dt->diff(new DateTime('NOW')->format('%y years'); -> return
$dt->diff(new DateTime('NOW'))->format('%y years'));
On 25 led, 15:00, Dw <[email protected]> wrote:
> Im looking to add a function to a doctrine generated model that will
> return the users age as a string.
>
> eg:
>
> class Child extends BaseChild
> {
> public function getAge()
> {
> $dt = new DateTime($this->getDateOfBirth());
> return $dt->diff(new DateTime('NOW')->format('%y years');
> }
>
> }
>
> But I keep getting
>
> Warning: range() [function.range]: step exceeds the specified range in
> Z:\web\projects\baby\lib\vendor\symfony\lib\yaml\sfYamlDumper.php on
> line 43
>
> It doesnt seem to like the diff function.
>
> Does anybody know why its doing this?
>
> Thanks, Dan
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en.