code
stringlengths 15
9.96M
| docstring
stringlengths 1
10.1k
| func_name
stringlengths 1
124
| language
stringclasses 1
value | repo
stringlengths 7
63
| path
stringlengths 6
186
| url
stringlengths 50
236
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
public function imap($host, $user, $pass, $port = null, $ssl = false, $tls = false)
{
Argument::i()
->test(1, 'string')
->test(2, 'string')
->test(3, 'string')
->test(4, 'int', 'null')
->test(5, 'bool')
->test(6, 'bool');
return Imap::i($host, $user, $pass, $port, $ssl, $tls);
} | Returns Mail IMAP
@param *string $host The IMAP host
@param *string $user The mailbox user name
@param *string $pass The mailbox password
@param int|null $port The IMAP port
@param bool $ssl Whether to use SSL
@param bool $tls Whether to use TLS
@return Eden\Mail\Imap | imap | php | Eden-PHP/Mail | src/Index.php | https://github.com/Eden-PHP/Mail/blob/master/src/Index.php | MIT |
public function pop3($host, $user, $pass, $port = null, $ssl = false, $tls = false)
{
Argument::i()
->test(1, 'string')
->test(2, 'string')
->test(3, 'string')
->test(4, 'int', 'null')
->test(5, 'bool')
->test(6, 'bool');
return Pop3::i($host, $user, $pass, $port, $ssl, $tls);
} | Returns Mail POP3
@param *string $host The POP3 host
@param *string $user The mailbox user name
@param *string $pass The mailbox password
@param int|null $port The POP3 port
@param bool $ssl Whether to use SSL
@param bool $tls Whether to use TLS
@return Eden\Mail\Pop3 | pop3 | php | Eden-PHP/Mail | src/Index.php | https://github.com/Eden-PHP/Mail/blob/master/src/Index.php | MIT |
public function smtp($host, $user, $pass, $port = null, $ssl = false, $tls = false)
{
Argument::i()
->test(1, 'string')
->test(2, 'string')
->test(3, 'string')
->test(4, 'int', 'null')
->test(5, 'bool')
->test(6, 'bool');
return Smtp::i($host, $user, $pass, $port, $ssl, $tls);
} | Returns Mail SMTP
@param *string $host The SMTP host
@param *string $user The mailbox user name
@param *string $pass The mailbox password
@param int|null $port The SMTP port
@param bool $ssl Whether to use SSL
@param bool $tls Whether to use TLS
@return Eden\Mail\Smtp | smtp | php | Eden-PHP/Mail | src/Index.php | https://github.com/Eden-PHP/Mail/blob/master/src/Index.php | MIT |
function tryGetFile($file){
try {
$file->get()->executeQuery();
}
catch (RequestException $ex){
if($ex->getCode() === 404){
return false;
}
throw $ex;
}
return true;
} | @param File $file
@throws RequestException | tryGetFile | php | vgrem/phpSPO | examples/SharePoint/Files/FileExists.php | https://github.com/vgrem/phpSPO/blob/master/examples/SharePoint/Files/FileExists.php | MIT |
function createContactCard()
{
$contactCard = Faker\Factory::create();
return array('Title' => $contactCard->username,
'FullName' => $contactCard->name,
'Email' => $contactCard->email,
'Company' => $contactCard->company,
'WorkPhone' => $contactCard->phoneNumber,
'WorkAddress' => $contactCard->streetAddress,
'WorkCity' => $contactCard->city,
'WorkZip' => $contactCard->postcode,
'WorkCountry' => $contactCard->country,
'WebPage' => array ('Url' => $contactCard->url)
);
} | @return array | createContactCard | php | vgrem/phpSPO | examples/SharePoint/ListItems/ListDataGenerator.php | https://github.com/vgrem/phpSPO/blob/master/examples/SharePoint/ListItems/ListDataGenerator.php | MIT |
function ensureList(Web $web, $listTitle, $type)
{
$lists = $web->getLists()->filter("Title eq '$listTitle'")->top(1)->get()->executeQuery();
if ($lists->getCount() == 1) {
return $lists->getData()[0];
}
return createList($web, $listTitle, $type);
} | @param Web $web
@param string $listTitle
@param int $type
@return SPList | ensureList | php | vgrem/phpSPO | examples/SharePoint/ListItems/ListDataGenerator.php | https://github.com/vgrem/phpSPO/blob/master/examples/SharePoint/ListItems/ListDataGenerator.php | MIT |
public function update()
{
$qry = new UpdateEntityQuery($this);
$this->getContext()->addQueryAndResultObject($qry, $this);
return $this;
} | The recommended way to update resource
@return self | update | php | vgrem/phpSPO | src/Entity.php | https://github.com/vgrem/phpSPO/blob/master/src/Entity.php | MIT |
public function deleteObject()
{
$qry = new DeleteEntityQuery($this);
$this->getContext()->addQuery($qry);
$this->removeFromParentCollection();
return $this;
} | The recommended way to delete resource
@return self | deleteObject | php | vgrem/phpSPO | src/Entity.php | https://github.com/vgrem/phpSPO/blob/master/src/Entity.php | MIT |
public function getId()
{
return $this->getProperty("Id");
} | @return string | getId | php | vgrem/phpSPO | src/Entity.php | https://github.com/vgrem/phpSPO/blob/master/src/Entity.php | MIT |
function setProperty($name, $value, $persistChanges = true)
{
$name = ucfirst($name);
if($name == "Id"){
if (is_null($this->getResourcePath())) {
$this->resourcePath = new ResourcePath($value, $this->parentCollection->getResourcePath());
}
}
parent::setProperty($name, $value, $persistChanges);
return $this;
} | @param string $name
@param mixed $value
@param bool $persistChanges
@return self | setProperty | php | vgrem/phpSPO | src/Entity.php | https://github.com/vgrem/phpSPO/blob/master/src/Entity.php | MIT |
public function __construct(callable $acquireToken)
{
$this->acquireTokenFunc = $acquireToken;
$this->getPendingRequest()->beforeExecuteRequest(function (RequestOptions $request) {
$this->authenticateRequest($request);
$this->prepareRequest($request);
});
parent::__construct();
} | Graph Client.
@param callable $acquireToken | __construct | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
function getPendingRequest()
{
if(!$this->pendingRequest){
$this->pendingRequest = new ODataRequest(new JsonFormat(ODataMetadataLevel::Verbose));
}
return $this->pendingRequest;
} | @return ODataRequest | getPendingRequest | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
private function prepareRequest(RequestOptions $request)
{
$query = $this->getCurrentQuery();
//set data modification headers
if ($query instanceof UpdateEntityQuery) {
$request->Method = HttpMethod::Patch;
} else if ($query instanceof DeleteEntityQuery) {
$request->Method = HttpMethod::Delete;
}
} | Prepare MicrosoftGraph request
@param RequestOptions $request | prepareRequest | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
public function getMe(){
return new User($this,new ResourcePath("me"));
} | @return User | getMe | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
public function getSites(){
return new EntityCollection($this,new ResourcePath("sites"),Site::class);
} | @return EntityCollection | getSites | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
public function getDrives(){
return new DriveCollection($this,new ResourcePath("drives"));
} | @return DriveCollection | getDrives | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
public function getApplications(){
return new EntityCollection($this,new ResourcePath("applications"),Application::class);
} | @return EntityCollection | getApplications | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
public function getUsers(){
return new UserCollection($this,new ResourcePath("users"));
} | Retrieve the properties and relationships of user object.
@return UserCollection | getUsers | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
public function getGroups(){
return new EntityCollection($this,new ResourcePath("groups"), Group::class);
} | @return EntityCollection | getGroups | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
public function getGroupSettings(){
return new EntityCollection($this,new ResourcePath("groupSettings"), GroupSetting::class);
} | @return EntityCollection | getGroupSettings | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
public function getTeams(){
return new TeamCollection($this,new ResourcePath("teams"));
} | @return TeamCollection | getTeams | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
public function getWorkbooks(){
return new EntityCollection($this,new ResourcePath("workbooks"),DriveItem::class);
} | @return EntityCollection | getWorkbooks | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
public function getReports(){
return new ReportRoot($this,new ResourcePath("reports"));
} | @return ReportRoot | getReports | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
public function getServiceRootUrl()
{
return "https://graph.microsoft.com/" . Office365Version::V1;
} | @return string | getServiceRootUrl | php | vgrem/phpSPO | src/GraphServiceClient.php | https://github.com/vgrem/phpSPO/blob/master/src/GraphServiceClient.php | MIT |
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, $itemTypeName = null)
{
parent::__construct($ctx, $resourcePath, $itemTypeName);
} | @param ClientRuntimeContext $ctx
@param ResourcePath|null $resourcePath
@param null $itemTypeName | __construct | php | vgrem/phpSPO | src/EntityCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/EntityCollection.php | MIT |
function getById($id)
{
return $this->createType(new ResourcePath($id, $this->getResourcePath()));
} | @param string $id Entity Id
@return ClientObject | getById | php | vgrem/phpSPO | src/EntityCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/EntityCollection.php | MIT |
public function add(){
/** @var Entity $entity */
$entity = $this->createType();
$this->addChild($entity);
$qry = new CreateEntityQuery($entity);
$this->getContext()->addQueryAndResultObject($qry,$entity);
return $entity;
} | A generic way to create a new resource
@return Entity | add | php | vgrem/phpSPO | src/EntityCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/EntityCollection.php | MIT |
public function offsetGet($offset)
{
if(is_int($offset))
return parent::offsetGet($offset);
return $this->getById($offset);
} | Returns the value at specified offset
@param int|string Entity could be addressed by id/userPrincipalName or by index offset
@access public
@return ClientObject
@abstracting ArrayAccess | offsetGet | php | vgrem/phpSPO | src/EntityCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/EntityCollection.php | MIT |
public function getProperty($name, $defaultValue=null)
{
if(isset($this->{$name}))
return $this->{$name};
return $defaultValue;
} | @param string $name
@param mixed|null $defaultValue
@return mixed | getProperty | php | vgrem/phpSPO | src/Runtime/ClientValue.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientValue.php | MIT |
public function getServerTypeInfo()
{
return ServerTypeInfo::resolve($this);
} | @return ServerTypeInfo | getServerTypeInfo | php | vgrem/phpSPO | src/Runtime/ClientValue.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientValue.php | MIT |
function toJson()
{
$json = array();
foreach (get_object_vars($this) as $key => $val) {
if (!is_null($val))
$json[$key] = $val;
}
return $json;
} | @return array | toJson | php | vgrem/phpSPO | src/Runtime/ClientValue.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientValue.php | MIT |
public function buildRequest(){
return $this->getPendingRequest()->buildRequest($this->getCurrentQuery());
} | @return RequestOptions | buildRequest | php | vgrem/phpSPO | src/Runtime/ClientRuntimeContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRuntimeContext.php | MIT |
public function load(ClientObject $clientObject, ?array $includeProperties = null)
{
$qry = new ReadEntityQuery($clientObject,$includeProperties);
$this->addQueryAndResultObject($qry, $clientObject);
return $this;
} | Prepare to load resource
@param ClientObject $clientObject
@param string[] $includeProperties
@return ClientRuntimeContext | load | php | vgrem/phpSPO | src/Runtime/ClientRuntimeContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRuntimeContext.php | MIT |
public function executeQuery()
{
while ($this->hasPendingRequest()) {
$qry = $this->getNextQuery();
$this->getPendingRequest()->executeQuery($qry);
}
} | Submit a client request | executeQuery | php | vgrem/phpSPO | src/Runtime/ClientRuntimeContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRuntimeContext.php | MIT |
public function executeQueryRetry($retryCount,$delaySecs, $currentRetry=0)
{
try{
$this->executeQuery();
}
catch(Exception $ex) {
if ($currentRetry > $retryCount || !($ex instanceof RequestException))
{
throw $ex;
}
sleep($delaySecs);
$this->addQuery($this->getCurrentQuery(),true);
$this->executeQueryRetry($retryCount,$delaySecs, $currentRetry+1);
}
} | Submit a query along with handling transient failures
@param int $retryCount
@param int $delaySecs
@throws Exception | executeQueryRetry | php | vgrem/phpSPO | src/Runtime/ClientRuntimeContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRuntimeContext.php | MIT |
public function executeQueryDirect(RequestOptions $options)
{
return $this->getPendingRequest()->executeQueryDirect($options);
} | @param RequestOptions $options
@return Response
@throws Exception | executeQueryDirect | php | vgrem/phpSPO | src/Runtime/ClientRuntimeContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRuntimeContext.php | MIT |
public function hasPendingRequest()
{
return count($this->getActions()) > 0;
} | @return bool | hasPendingRequest | php | vgrem/phpSPO | src/Runtime/ClientRuntimeContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRuntimeContext.php | MIT |
public function addQueryAndResultObject(ClientAction $query, $returnType = null)
{
$query->ReturnType = $returnType;
$this->addQuery($query, false);
} | @param ClientAction $query
@param ClientObject|ClientResult $returnType | addQueryAndResultObject | php | vgrem/phpSPO | src/Runtime/ClientRuntimeContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRuntimeContext.php | MIT |
public function getServerLibraryVersion(){
return new Version();
} | Gets the build version.
@return Version | getServerLibraryVersion | php | vgrem/phpSPO | src/Runtime/ClientRuntimeContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRuntimeContext.php | MIT |
protected function getNextQuery()
{
$qry = array_shift($this->queries);
$this->currentQuery = $qry;
return $qry;
} | @return ClientAction|null | getNextQuery | php | vgrem/phpSPO | src/Runtime/ClientRuntimeContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRuntimeContext.php | MIT |
public function getCurrentQuery(){
return $this->currentQuery;
} | @return ClientAction | getCurrentQuery | php | vgrem/phpSPO | src/Runtime/ClientRuntimeContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRuntimeContext.php | MIT |
public function getActions(){
return $this->queries;
} | @return ClientAction[] | getActions | php | vgrem/phpSPO | src/Runtime/ClientRuntimeContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRuntimeContext.php | MIT |
public function addQuery(ClientAction $query, $executeFirst=false)
{
if($executeFirst)
array_unshift($this->queries , $query);
else
$this->queries[] = $query;
} | Add query into request queue
@param ClientAction $query
@param bool $executeFirst | addQuery | php | vgrem/phpSPO | src/Runtime/ClientRuntimeContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRuntimeContext.php | MIT |
public function getSite()
{
if(!isset($this->site)){
$this->site = new Site($this->getContext(),new ResourcePath("Site",$this->getResourcePath()));
}
return $this->site;
} | @return Site | getSite | php | vgrem/phpSPO | src/Runtime/RequestContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/RequestContext.php | MIT |
public function getWeb()
{
if(!isset($this->web)){
$this->web = new Web($this->getContext(),new ResourcePath("Web",$this->getResourcePath()));
}
return $this->web;
} | @return mixed|null|Site | getWeb | php | vgrem/phpSPO | src/Runtime/RequestContext.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/RequestContext.php | MIT |
public function __construct($namespace = null, $name = null, $collection=false)
{
$this->Namespace = $namespace;
$this->Name = $name;
$this->Id = null;
$this->Collection = $collection;
} | @param string $namespace
@param string $name
@param boolean $collection | __construct | php | vgrem/phpSPO | src/Runtime/ServerTypeInfo.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ServerTypeInfo.php | MIT |
public static function fromFullName($value){
$parts = explode(".", $value);
$typeName = end($parts);
$namespace = implode(".", array_slice($parts, 0,-1));
return new ServerTypeInfo($namespace, $typeName);
} | @param string $value
@return ServerTypeInfo | fromFullName | php | vgrem/phpSPO | src/Runtime/ServerTypeInfo.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ServerTypeInfo.php | MIT |
public static function primitive($typeName, $isCollection = false)
{
if (array_key_exists($typeName, self::$PrimitiveTypeMappings)) {
$primitiveTypeName = self::$PrimitiveTypeMappings[$typeName];
return new ServerTypeInfo("Edm", $primitiveTypeName, $isCollection);
}
throw new Exception("Unknown primitive type: $typeName");
} | @return ServerTypeInfo
@throws Exception | primitive | php | vgrem/phpSPO | src/Runtime/ServerTypeInfo.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ServerTypeInfo.php | MIT |
public function __construct($itemTypeName)
{
$this->itemTypeName = $itemTypeName;
parent::__construct();
} | @param string $itemTypeName | __construct | php | vgrem/phpSPO | src/Runtime/ClientValueCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientValueCollection.php | MIT |
public static function fromArray($itemTypeName,$values)
{
$col = new ClientValueCollection($itemTypeName);
foreach ($values as $value)
$col->addChild($value);
return $col;
} | @param string $itemTypeName
@param array $values
@return ClientValueCollection | fromArray | php | vgrem/phpSPO | src/Runtime/ClientValueCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientValueCollection.php | MIT |
public function addChild($value)
{
if (is_null($this->data))
$this->data = array();
$this->data[] = $value;
} | Adds property to collection
@param ClientValue|string $value | addChild | php | vgrem/phpSPO | src/Runtime/ClientValueCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientValueCollection.php | MIT |
public function getData()
{
return $this->data;
} | @return array | getData | php | vgrem/phpSPO | src/Runtime/ClientValueCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientValueCollection.php | MIT |
public function clearData()
{
$this->data = array();
} | Clear collection | clearData | php | vgrem/phpSPO | src/Runtime/ClientValueCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientValueCollection.php | MIT |
public function getCount()
{
return count($this->data);
} | @return int | getCount | php | vgrem/phpSPO | src/Runtime/ClientValueCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientValueCollection.php | MIT |
public function createType()
{
$clientValueType = $this->getItemTypeName();
return new $clientValueType();
} | Creates entity for a collection
@return ClientValue | createType | php | vgrem/phpSPO | src/Runtime/ClientValueCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientValueCollection.php | MIT |
function getItemTypeName()
{
if(isset($this->itemTypeName)) {
return $this->itemTypeName;
}
return str_replace("Collection","",get_class($this));
} | @return string | getItemTypeName | php | vgrem/phpSPO | src/Runtime/ClientValueCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientValueCollection.php | MIT |
function toJson()
{
return array_map(function (ClientValue $item) {
return $item->toJson();
}, $this->getData());
} | @return array | toJson | php | vgrem/phpSPO | src/Runtime/ClientValueCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientValueCollection.php | MIT |
public function beforeExecuteRequest(callable $event)
{
$this->beforeExecute->addEvent($event, false);
} | @param callable $event | beforeExecuteRequest | php | vgrem/phpSPO | src/Runtime/ClientRequest.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRequest.php | MIT |
public function beforeExecuteRequestOnce(callable $event)
{
$this->beforeExecute->addEvent($event, true);
} | @param callable $event | beforeExecuteRequestOnce | php | vgrem/phpSPO | src/Runtime/ClientRequest.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRequest.php | MIT |
public function afterExecuteRequest(callable $event, $once = true)
{
$this->afterExecute->addEvent($event, $once);
} | @param callable $event
@param bool $once | afterExecuteRequest | php | vgrem/phpSPO | src/Runtime/ClientRequest.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRequest.php | MIT |
public function executeQuery($query)
{
try {
$request = $this->buildRequest($query);
$response = $this->executeQueryDirect($request);
$this->processResponse($response, $query);
$this->afterExecute->triggerEvent(array($response));
$this->requestStatus = ClientRequestStatus::CompletedSuccess;
} catch (Exception $e) {
$this->requestStatus = ClientRequestStatus::CompletedException;
throw $e;
}
} | Submit a query
@throws Exception | executeQuery | php | vgrem/phpSPO | src/Runtime/ClientRequest.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRequest.php | MIT |
public function executeQueryDirect(RequestOptions $request)
{
$this->beforeExecute->triggerEvent(array($request));
$response = Requests::execute($request);
$this->validate($response);
return $response;
} | @param RequestOptions $request
@return Response
@throws Exception | executeQueryDirect | php | vgrem/phpSPO | src/Runtime/ClientRequest.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRequest.php | MIT |
public function getRequestStatus()
{
return $this->requestStatus;
} | @return int | getRequestStatus | php | vgrem/phpSPO | src/Runtime/ClientRequest.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRequest.php | MIT |
public function validate($response)
{
if ($response->getStatusCode() >= 400) {
throw new RequestException($response->getContent(), $response->getStatusCode());
}
return true;
} | @param Response $response
@return bool
@throws Exception | validate | php | vgrem/phpSPO | src/Runtime/ClientRequest.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientRequest.php | MIT |
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, $itemTypeName=null)
{
parent::__construct($ctx, $resourcePath);
$this->data = array();
$this->NextRequestUrl = null;
$this->itemTypeName = $itemTypeName;
$this->pagedMode = false;
$this->pageInfo = new PageInfo();
$this->pageLoaded = new EventHandler();
} | @param ClientRuntimeContext $ctx
@param ResourcePath $resourcePath
@param string $itemTypeName | __construct | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
function getServerObjectIsNull()
{
return !is_array($this->data);
} | @return bool | getServerObjectIsNull | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function addChildAt(ClientObject $clientObject, $index)
{
array_splice($this->data, $index, 0, [$clientObject]);
if (is_null($clientObject->parentCollection))
$clientObject->parentCollection = $this;
} | Adds client object into collection
@param ClientObject $clientObject
@param int $index | addChildAt | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function addChild($clientObject)
{
$this->data[] = $clientObject;
if (is_null($clientObject->parentCollection))
$clientObject->parentCollection = $this;
return $this;
} | Adds client object into collection
@param ClientObject $clientObject | addChild | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function removeChild(ClientObject $clientObject)
{
if (($key = array_search($clientObject, $this->data)) !== false) {
unset($this->data[$key]);
}
} | @param ClientObject $clientObject | removeChild | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function getData()
{
return $this->data;
} | @return array | getData | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function getItem($index)
{
return $this->data[$index];
} | Gets the item at the specified index
@param $index
@return ClientObject | getItem | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function getCount()
{
$it = $this->getIterator();
while($it->valid() ){
$it->next();
}
return count($this->data);
} | Returns total items count
@return int
@throws Exception | getCount | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function filter($value)
{
$this->queryOptions->Filter = rawurlencode($value);
return $this;
} | Specifies an expression or function that must evaluate to true for a record to be returned in the collection.
@param string $value
@return ClientObjectCollection $this | filter | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function paged($pageSize=null, $pageLoaded=null){
$this->pagedMode = true;
if(isset($pageLoaded))
$this->pageLoaded->addEvent($pageLoaded);
if(isset($pageSize)){
$this->top($pageSize);
}
return $this;
} | Retrieves via server-driven paging mode
@param int $pageSize
@param callable $pageLoaded | paged | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function orderBy($value)
{
$this->queryOptions->OrderBy = rawurlencode($value);
return $this;
} | Determines the maximum number of records to return.
@param string $value
@return ClientObjectCollection $this | orderBy | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function top($value)
{
$this->queryOptions->Top = $value;
return $this;
} | Determines the maximum number of records to return.
@param int $value
@return ClientObjectCollection $this | top | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function skip($value)
{
$this->queryOptions->Skip = $value;
return $this;
} | Sets the number of records to skip before it retrieves records in a collection.
@param int $value
@return ClientObjectCollection $this | skip | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function skiptoken($value)
{
$this->queryOptions->SkipToken = rawurlencode($value);
return $this;
} | Sets the number of records to skip before it retrieves records in a collection.
@param string $value
@return ClientObjectCollection $this | skiptoken | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function createType($resourcePath=null)
{
$itemTypeName = $this->getItemTypeName();
$clientObject = new $itemTypeName($this->getContext(),$resourcePath);
$clientObject->parentCollection = $this;
return $clientObject;
} | Creates resource for a collection
@param ResourcePath|null $resourcePath
@return ClientObject | createType | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function getItemTypeName()
{
if(!is_null($this->itemTypeName))
return $this->itemTypeName;
return str_replace("Collection", "", get_class($this));
} | @return string | getItemTypeName | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function get()
{
$this->getContext()->getPendingRequest()->afterExecuteRequest(function (){
$this->pageInfo->setNextPage(count($this->data));
$this->pageLoaded->triggerEvent(array($this));
});
return parent::get();
} | @return self | get | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function getAll($pageSize=null, $pageLoaded=null)
{
$this->paged($pageSize,$pageLoaded);
$this->getContext()->getPendingRequest()->afterExecuteRequest(function (){
if($this->hasNext()) {
$this->getNext();
}
}, false);
return $this->get();
} | Gets all the items in a collection, regardless of the size.
@param int $pageSize
@param callable $pageLoaded
@return self | getAll | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
private function getNext(){
$this->getContext()->getPendingRequest()->beforeExecuteRequest(function (RequestOptions $request){
$request->Url = $this->NextRequestUrl;
});
$this->get();
return $this;
} | @return ClientObjectCollection
@throws Exception | getNext | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function offsetGet($offset)
{
return $this->offsetExists($offset) ? $this->data[$offset] : null;
} | Returns the value at specified offset
@param int The offset to retrieve
@access public
@return ClientObject
@abstracting ArrayAccess | offsetGet | php | vgrem/phpSPO | src/Runtime/ClientObjectCollection.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObjectCollection.php | MIT |
public function __construct($name, ?ResourcePath $parent = null)
{
$this->name = $name;
$this->parent = $parent;
} | @param string $name
@param ResourcePath|null $parent | __construct | php | vgrem/phpSPO | src/Runtime/ResourcePath.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ResourcePath.php | MIT |
public function getSegments(){
return ["/", $this->name];
} | @return string[] | getSegments | php | vgrem/phpSPO | src/Runtime/ResourcePath.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ResourcePath.php | MIT |
public function getName(){
return $this->name;
} | @return string | getName | php | vgrem/phpSPO | src/Runtime/ResourcePath.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ResourcePath.php | MIT |
public function getParent(){
return $this->parent;
} | @return null|ResourcePath | getParent | php | vgrem/phpSPO | src/Runtime/ResourcePath.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ResourcePath.php | MIT |
public function toUrl()
{
$allSegments = array();
$current = clone $this;
while (isset($current)) {
$allSegments = array_merge($current->getSegments(), $allSegments);
$current = $current->getParent();
}
return implode("", $allSegments);
} | @return string | toUrl | php | vgrem/phpSPO | src/Runtime/ResourcePath.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ResourcePath.php | MIT |
public function __construct(ClientRuntimeContext $ctx,
?ResourcePath $resourcePath = null,
?ODataQueryOptions $queryOptions = null,
$namespace=null)
{
$this->context = $ctx;
$this->resourcePath = $resourcePath;
$this->namespace = $namespace;
$this->properties = array();
$this->queryOptions = $queryOptions;
if (!isset($this->queryOptions))
$this->queryOptions = new ODataQueryOptions();
else
$this->queryOptions = $queryOptions;
} | ClientObject constructor.
@param ClientRuntimeContext $ctx
@param ResourcePath|null $resourcePath
@param ODataQueryOptions|null $queryOptions
@param string|null $namespace | __construct | php | vgrem/phpSPO | src/Runtime/ClientObject.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObject.php | MIT |
public function get(){
$this->getContext()->load($this);
return $this;
} | @return self | get | php | vgrem/phpSPO | src/Runtime/ClientObject.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObject.php | MIT |
public function buildRequest(){
return $this->getContext()->buildRequest();
} | @return RequestOptions | buildRequest | php | vgrem/phpSPO | src/Runtime/ClientObject.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObject.php | MIT |
public function executeQuery(){
$this->getContext()->executeQuery();
return $this;
} | Submit a client request
@return self | executeQuery | php | vgrem/phpSPO | src/Runtime/ClientObject.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObject.php | MIT |
public function executeQueryRetry($retryCount=3,$delaySecs=10){
$this->getContext()->executeQueryRetry($retryCount,$delaySecs);
return $this;
} | Submit a query along with handling transient failures
@param int $retryCount
@param int $delaySecs
@return self
@throws Exception | executeQueryRetry | php | vgrem/phpSPO | src/Runtime/ClientObject.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObject.php | MIT |
public function getQueryOptions()
{
return $this->queryOptions;
} | @return ODataQueryOptions | getQueryOptions | php | vgrem/phpSPO | src/Runtime/ClientObject.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObject.php | MIT |
public function getParentCollection()
{
return $this->parentCollection;
} | @return self | getParentCollection | php | vgrem/phpSPO | src/Runtime/ClientObject.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObject.php | MIT |
public function getContext()
{
return $this->context;
} | @return ClientRuntimeContext | getContext | php | vgrem/phpSPO | src/Runtime/ClientObject.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObject.php | MIT |
protected function removeFromParentCollection()
{
if ($this->parentCollection === null) {
return;
}
$this->parentCollection->removeChild($this);
} | Removes object from parent collection | removeFromParentCollection | php | vgrem/phpSPO | src/Runtime/ClientObject.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObject.php | MIT |
public function getResourcePath()
{
return $this->resourcePath;
} | Resolve the resource path
@return ResourcePath | getResourcePath | php | vgrem/phpSPO | src/Runtime/ClientObject.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObject.php | MIT |
public function getResourceUrl()
{
$url = $this->getContext()->getServiceRootUrl() . $this->getResourcePath()->toUrl();
if (!$this->getQueryOptions()->isEmpty()) {
$url .= '?' . $this->getQueryOptions()->toUrl();
}
return $url;
} | Resolve the resource path
@return string | getResourceUrl | php | vgrem/phpSPO | src/Runtime/ClientObject.php | https://github.com/vgrem/phpSPO/blob/master/src/Runtime/ClientObject.php | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.