phpCAS  version 1.4.0
Abstract.php
Go to the documentation of this file.
1 <?php
2 
43 {
44 
49  private $_proxyTicket;
50 
61  public function setProxyTicket ($proxyTicket)
62  {
63  if (empty($proxyTicket)) {
65  'Trying to initialize with an empty proxy ticket.'
66  );
67  }
68  if (!empty($this->_proxyTicket)) {
70  'Already initialized, cannot change the proxy ticket.'
71  );
72  }
73  $this->_proxyTicket = $proxyTicket;
74  }
75 
83  protected function getProxyTicket ()
84  {
85  if (empty($this->_proxyTicket)) {
87  'No proxy ticket yet. Call $this->initializeProxyTicket() to aquire the proxy ticket.'
88  );
89  }
90 
91  return $this->_proxyTicket;
92  }
93 
97  private $_casClient;
98 
112  public function setCasClient (CAS_Client $casClient)
113  {
114  if (!empty($this->_proxyTicket)) {
115  throw new CAS_OutOfSequenceException(
116  'Already initialized, cannot change the CAS_Client.'
117  );
118  }
119 
120  $this->_casClient = $casClient;
121  }
122 
133  protected function initializeProxyTicket()
134  {
135  if (!empty($this->_proxyTicket)) {
136  throw new CAS_OutOfSequenceException(
137  'Already initialized, cannot initialize again.'
138  );
139  }
140  // Allow usage of a particular CAS_Client for unit testing.
141  if (empty($this->_casClient)) {
143  } else {
144  $this->_casClient->initializeProxiedService($this);
145  }
146  }
147 
148 }
149 ?>
setCasClient(CAS_Client $casClient)
Definition: Abstract.php:112
setProxyTicket($proxyTicket)
Definition: Abstract.php:61
static initializeProxiedService(CAS_ProxiedService $proxiedService)
Definition: CAS.php:943