work in progress: prepping for storage of extended profile details
This commit is contained in:
parent
59f4734985
commit
d1a96dc7af
16
plugins/ExtendedProfile/Profile_detail.php
Normal file
16
plugins/ExtendedProfile/Profile_detail.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* To change this template, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
class Profile_detail extends Memcached_DataObject
|
||||||
|
{
|
||||||
|
public $id;
|
||||||
|
public $profile_id;
|
||||||
|
public $field;
|
||||||
|
public $index; // relative ordering of multiple values in the same field
|
||||||
|
public $value; // primary text value
|
||||||
|
public $rel; // detail for some field types; eg "home", "mobile", "work" for phones or "aim", "irc", "xmpp" for IM
|
||||||
|
public $ref_profile; // for people types, allows pointing to a known profile in the system
|
||||||
|
|
||||||
|
}
|
@ -23,6 +23,25 @@ if (!defined('STATUSNET')) {
|
|||||||
|
|
||||||
class ExtendedProfile
|
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()
|
function getSections()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
Loading…
Reference in New Issue
Block a user