Corrected the total number in events (Closes #1566)
[platal.git] / classes / profile.php
index 162f4bd..104702b 100644 (file)
@@ -321,6 +321,16 @@ class Profile implements PlExportable
         }
     }
 
+    // Returns younger/older promotion year for a given education.
+    static public function extremePromotions($education)
+    {
+        return XDB::fetchOneRow("SELECT  MIN(pe.promo_year) AS min, MAX(pe.promo_year) AS max
+                                     FROM  profile_education             AS pe
+                               INNER JOIN  profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
+                                    WHERE  pede.degree = {?} AND FIND_IN_SET('primary', pe.flags)",
+                                  $education);
+    }
+
     /** Print a name with the given formatting:
      * %s = • for women
      * %f = firstname
@@ -942,6 +952,19 @@ class Profile implements PlExportable
             return array();
         }
     }
+
+    public function getFullBinets()
+    {
+        if ($this->visibility->isVisible(Visibility::EXPORT_PRIVATE)) {
+            return XDB::fetchAllAssoc('SELECT  binet_id, text, url
+                                         FROM  profile_binets AS pb
+                                    LEFT JOIN  profile_binet_enum AS pbe ON (pbe.id = pb.binet_id)
+                                        WHERE  pid = {?}', $this->id());
+        } else {
+            return array();
+        }
+    }
+
     public function getBinetsNames()
     {
         if ($this->visibility->isVisible(Visibility::EXPORT_PRIVATE)) {