Skip to content

Instantly share code, notes, and snippets.

@fabiocarneiro
Last active August 29, 2015 14:10
Show Gist options
  • Save fabiocarneiro/3ea15020029cf765f482 to your computer and use it in GitHub Desktop.
Save fabiocarneiro/3ea15020029cf765f482 to your computer and use it in GitHub Desktop.
<?php
namespace Product\Criteria;
use Doctrine\Common\Collections\Criteria;
/**
* Order the units by the last modified one
*
* @author Fábio Carneiro <[email protected]>
* @license proprietary
*/
class LastModifiedUnit extends Criteria
{
public function __construct()
{
$this->orderBy(['modified' => static::DESC]);
$this->setMaxResults(1);
return $this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment