Skip to content

Instantly share code, notes, and snippets.

@jenkoian
Created January 29, 2013 22:10
Show Gist options
  • Save jenkoian/4668420 to your computer and use it in GitHub Desktop.
Save jenkoian/4668420 to your computer and use it in GitHub Desktop.
Simple example of getting the last modified date from a child controller
<?php
/**
* Find the last modified date
*
* @return \DateTime
*/
public function getLastModifiedDate()
{
$modifiedDate = $this->thingRepository->findLastModifiedThing();
if ($modifiedDate instanceof \DateTime) {
return $modifiedDate;
}
return new \DateTime();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment