Example #1
0
 function getPrimaryResourcesTypes($pri_resource_id = 0)
 {
     $pri_resource_id = intval($pri_resource_id);
     //quit if id not specified
     if ($pri_resource_id == 0) {
         return array();
     }
     $pri_resources_types = array();
     // cid=>[type id]+
     include_once TR_INCLUDE_PATH . 'classes/DAO/PrimaryResourcesTypesDAO.class.php';
     $primaryResourcesTypesDAO = new PrimaryResourcesTypesDAO();
     $rows = $primaryResourcesTypesDAO->getByResourceID($pri_resource_id);
     if (is_array($rows)) {
         foreach ($rows as $row) {
             $pri_resources_types[$pri_resource_id][] = $row['type_id'];
         }
     }
     return $pri_resources_types;
 }