keesschepers

orm association with criteria

Mar 23rd, 2014
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1.     /**
  2.      * Returns all enabled products
  3.      *
  4.      * @return array
  5.      */
  6.     public function getProducts()
  7.     {
  8.         $criteria = Criteria::create()
  9.             ->where(Criteria::expr()->eq("status", true))
  10.             ->orderBy(array("weight" => Criteria::ASC));
  11.  
  12.         return $this->products->matching($criteria);
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment