Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

restauthorizedclient.php
Go to the documentation of this file.
1 <?php
16 class ezpRestAuthorizedClient
17 {
18 public $id = null;
19
24 public $rest_client_id = null;
25
30 public $user_id = null;
31
36 public $created = null;
37
38 public function getState()
39 {
40 $result = array();
41 $result['id'] = $this->id;
42 $result['rest_client_id'] = $this->rest_client_id;
43 $result['user_id'] = $this->user_id;
44 $result['created'] = $this->created;
45 return $result;
46 }
47
48 public function setState( array $properties )
49 {
50 foreach( $properties as $key => $value )
51 {
52 $this->$key = $value;
53 }
54 }
55
61 public static function fetchForClientUser( ezpRestClient $client, eZUser $user )
62 {
63 $session = ezcPersistentSessionInstance::get();
64
65 $q = $session->createFindQuery( __CLASS__ );
66
67 $q->where( $q->expr->eq( 'rest_client_id', $q->bindValue( $client->id ) ) )
68 ->where( $q->expr->eq( 'user_id', $q->bindValue( $user->attribute( 'contentobject_id' ) ) ) );
69
70 $results = $session->find( $q, __CLASS__ );
71
72 if ( count( $results ) != 1 )
73 return false;
74 else
75 return array_shift( $results );
76 }
77 }
78 ?>
$session
$session
Definition: admin/articlelist.php:44
eZUser
Definition: ezuser.php:76
ezpRestAuthorizedClient
Definition: restauthorizedclient.php:17
ezpRestAuthorizedClient\$user_id
$user_id
Definition: restauthorizedclient.php:30
ezpRestAuthorizedClient\$created
$created
Definition: restauthorizedclient.php:36
ezpRestAuthorizedClient\getState
getState()
Definition: restauthorizedclient.php:38
ezpRestAuthorizedClient\setState
setState(array $properties)
Definition: restauthorizedclient.php:48
ezpRestAuthorizedClient\fetchForClientUser
static fetchForClientUser(ezpRestClient $client, eZUser $user)
Definition: restauthorizedclient.php:61
ezpRestAuthorizedClient\$rest_client_id
$rest_client_id
Definition: restauthorizedclient.php:24
ezpRestAuthorizedClient\$id
$id
Definition: restauthorizedclient.php:18
ezpRestClient
Definition: restclient.php:16
$result
$result
Definition: companysearch.php:94
$results
$results
Definition: companysearch.php:81
$q
$q
Definition: modules/oauthadmin/list.php:17
$user
$user
Definition: user/adlist.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.