Example #1
0
 /**
  * The function returns last added Products.
  * 
  * @access public
  * @param int $limit The limit of result.
  * @param mixed $category The Category object or id or layout.
  * @return array The Products.
  */
 public static function getLastProducts($limit = 10, $category = null)
 {
     $Product = new self();
     $params = array();
     if ($category instanceof Product_Layout) {
         $params[] = 'CategoryId = ' . $category->getCategory()->Id;
     }
     return $Product->findShortList($params, 'Position asc', 0, $limit);
 }
Example #2
0
 public static function getLastProudsId($limit = 10, $category = null)
 {
     $Proud = new self();
     $params = array();
     if ($category != null) {
         $params[] = 'CategoryId = ' . $category;
     }
     return $Proud->findShortList($params, 'Position desc', 0, $limit);
 }
Example #3
0
 /**
  * The function returns pages which set in menu.
  * 
  * @static
  * @param int $parent The parent id.
  * @return array The Pages in menu.
  */
 public static function getMenu($parent = 0)
 {
     $Page = new self();
     $params = array();
     $params[] = 'ParentId = ' . intval($parent);
     $params[] = 'InMenu = 1';
     return $Page->findShortList($params, 'Position asc');
 }