Example #1
0
 /**
  * The function returns all branches.
  * 
  * @static
  * @access public
  * @param bool $assoc If TRUE returns associated array.
  * @return array The Brands.
  */
 public static function getBranches($assoc = false)
 {
     $Branch = new self();
     $arr = $Branch->findList(array(), 'Position asc');
     if (!$assoc) {
         return $arr;
     }
     return self::convertArray($arr, 'Id', 'Name');
 }
Example #2
0
 /**
  * The function returns all assemblies.
  * 
  * @static
  * @access public
  * @param bool $assoc If TRUE returns associated array.
  * @return array The assemblies.
  */
 public static function getAssemblies($assoc = false)
 {
     $Assembly = new self();
     $result = array();
     $arr = $Assembly->findList(array(), 'Position asc');
     if (!$assoc) {
         return $arr;
     }
     return self::convertArray($arr, 'Id', 'Name');
 }
Example #3
0
 /**
  * The function returns array of Images.
  * 
  * @static
  * @access public
  * @param bool $assoc If TRUE returns associative array of images.
  * @return array The Images.
  */
 public static function getImages($assoc = false)
 {
     $Image = new self();
     $array = $Image->findList(array(), 'Name asc');
     if (!$assoc) {
         return $array;
     }
     $result = array();
     foreach ($array as $Image) {
         $result[$Image->Id] = $Image->Name;
     }
     return $result;
 }
Example #4
0
 /**
  * The function returns all types.
  * 
  * @static
  * @access public
  * @param bool $assoc If TRUE returns associated array.
  * @param mixed $populatedOnly If TRUE returns only populated 
  * @return array The Types.
  */
 public static function getTypes($assoc = false, $populatedOnly = false)
 {
     $Type = new self();
     $result = array();
     $params = array();
     if ($populatedOnly === true) {
         $params[] = '* Id in (select distinct TypeId from products)';
     } else {
         if ($populatedOnly instanceof Product_Category) {
             $params[] = '* Id in (select distinct TypeId from products where CategoryId = ' . $populatedOnly->Id . ')';
         }
     }
     $arr = $Type->findList($params, 'Position asc');
     if (!$assoc) {
         return $arr;
     }
     return self::convertArray($arr, 'Id', 'Name');
 }
Example #5
0
 /**
  * The function returns array of Admins.
  * 
  * @static
  * @access public
  * @param bool $weekOnly If TRUE returns only regular admins, otherwise returns regular and super.
  * @return array The Admins.
  */
 public static function getAdmins($weakOnly = false)
 {
     $Admin = new self();
     $params = array();
     if ($weakOnly) {
         $params[] = 'IsSuper = 0';
     }
     return $Admin->findList($params, 'Login asc');
 }
Example #6
0
 /**
  * The function returns all shipping methods.
  * 
  * @static
  * @access public
  * @param bool $assoc If TRUE returns associated array.
  * @return array The shipping methods.
  */
 public static function getShippings($assoc = false)
 {
     $Shipping = new self();
     $result = array();
     $arr = $Shipping->findList(array(), 'Position asc');
     if (!$assoc) {
         return $arr;
     }
     return self::convertArray($arr, 'Id', 'Name');
 }
Example #7
0
 /**
  * The function returns children pages for current page id.
  *
  * @static
  * @access public
  * @param int $parent The parent id.
  * @param int $exclude The page id to exclude.
  * @return array The children Pages.
  */
 public static function getChildren($parent = 0, $exclude = null)
 {
     $Page = new self();
     $params = array('ParentId = ' . $parent);
     if ($exclude) {
         $params[] = 'Id <> ' . $exclude;
     }
     return $Page->findList($params, 'Position asc');
 }
Example #8
0
 /**
  * The function returns array of subscribers emails.
  * 
  * @static
  * @access public
  * @param int $limit The limit of result.
  * @returns array The emails.
  */
 public static function getEmails($limit = 100)
 {
     $result = array();
     $Item = new self();
     foreach ($Item->findList(array(), 'Email asc', 0, $limit) as $Item) {
         $result[] = $Item->Email;
     }
     return $result;
 }
Example #9
0
 public static function findCurrencies($onlyActive = false)
 {
     $Currency = new self();
     $params = array();
     if ($onlyActive) {
         $params[] = 'IsEnabled = 1';
     }
     return $Currency->findList($params, 'Position asc');
 }