/** * SharePoint User constructor * * @access public * @param SPSite $site SharePoint Site * @param array $json JSON response from the SharePoint REST API * @param array $extra Extra properties to map * @throws SPException * @return SPUser */ public function __construct(SPSite $site, array $json, array $extra = []) { parent::__construct(['account' => 'AccountName', 'email' => 'Email', 'fullName' => 'DisplayName', 'firstName' => 'UserProfileProperties->4->Value', 'lastName' => 'UserProfileProperties->6->Value', 'title' => 'Title', 'picture' => 'PictureUrl', 'url' => 'PersonalUrl'], $extra); $this->site = $site; $this->hydrate($json); }
/** * parse link (replace placeholders) * @param SPObject $cat * @return string */ private function parseLink($cat) { static $placeHolders = array('{sid}', '{name}', '{introtext}'); $replacement = array($cat->get('id'), $cat->get('name'), $cat->get('introtext')); $link = str_replace($placeHolders, $replacement, $this->_url); Sobi::Trigger('SigsiuTree', ucfirst(__FUNCTION__), array(&$link)); return $link; }
/** * @param string $attr * @return bool */ public function has($attr) { return parent::has($attr) || $this->_type && $this->_type->get($attr); }
/** * SharePoint Item constructor * * @access public * @param SPList $list SharePoint List object * @param array $json JSON response from the SharePoint REST API * @param array $extra Extra SharePoint Item properties to map * @return SPItem */ public function __construct(SPList $list, array $json, array $extra = []) { parent::__construct(['type' => 'odata.type', 'id' => 'Id', 'guid' => 'GUID', 'title' => 'Title', 'created' => 'Created', 'modified' => 'Modified'], $extra); $this->list = $list; $this->hydrate($json); }