]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/ExtendedProfile/extendedprofile.php
work in progress: prepping for storage of extended profile details
[quix0rs-gnu-social.git] / plugins / ExtendedProfile / extendedprofile.php
index 18fef20331f8ff3900d77a46bd6b88bfac0def70..7f69f90899237e479cb8e09d276352a41d4d5343 100644 (file)
@@ -23,6 +23,25 @@ if (!defined('STATUSNET')) {
 
 class ExtendedProfile
 {
+    function __construct(Profile $profile)
+    {
+        $this->profile = $profile;
+        $this->sections = $this->getSections();
+        $this->fields = $this->loadFields();
+    }
+
+    function loadFields()
+    {
+        $detail = new Profile_detail();
+        $detail->profile_id = $this->profile->id;
+        $detail->find();
+        
+        while ($detail->get()) {
+            $fields[$detail->field][] = clone($detail);
+        }
+        return $fields;
+    }
+
     function getSections()
     {
         return array(