diff -r 06a22ff5d58d -r 13f43f53d0ba Entity/DocumentTagRepository.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Entity/DocumentTagRepository.php Sun Oct 16 14:50:48 2011 +0200 @@ -0,0 +1,37 @@ +getEntityManager() + ->createQuery("SELECT doctag FROM WikiTagBundle:DocumentTag doctag WHERE doctag.document=:doc_id ORDER BY doctag.tagOrder ASC") + ->setParameter("doc_id", $doc_id) + ->getResult(); + } + + /** + * Gets the max order of all tags for one document + */ + public function getMaxOrder($doc_id) + { + return $this->getEntityManager() + ->createQuery("SELECT MAX(doctag.tagOrder) FROM WikiTagBundle:DocumentTag doctag WHERE doctag.document= :doc_id") + ->setParameter("doc_id", $doc_id) + ->getResult(); + } + +} \ No newline at end of file