예제 #1
0
 /**
  * Constructor
  * @param mixed $id
  * @param array $parameters
  */
 function __construct($id, $parameters = null, $preload = false)
 {
     if ($parameters === null) {
         $parameters = array('fields' => self::getAllowedFields());
     }
     parent::__construct($id, $parameters, $preload);
 }
예제 #2
0
 function __get($property)
 {
     if ($property === 'friends') {
         $parameters = array('fields' => $this->getAllowedFields(array('friend' => true)), 'local_cache' => true);
         $this->__set(array($property => $this->getFriends($parameters)));
         return $this->{$property};
     }
     if ($property === 'mutualfriends') {
         $this->__set(array($property => $this->getMutualfriendWith(Facebook::me()->id)));
         return $this->{$property};
     }
     return parent::__get($property);
 }
예제 #3
0
 /**
  * Constructor
  * @param mixed $id
  * @param array $parameters
  * @param bool $preload  true: Fetch fields now. false: Fetch fields when needed.
  */
 function __construct($id, $parameters = null, $preload = false)
 {
     if ($id === null || is_array($id)) {
         parent::__construct($id, $parameters, $preload);
         return;
     }
     if ($parameters === null) {
         // Fetch all allowed fields?
         $parameters = array('fields' => implode(',', $this->getAllowedFields(array('id' => $id))));
     }
     parent::__construct($id, $parameters, $preload);
 }