import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
@ -16,14 +16,9 @@
|
||||
* @package Zend_InfoCard
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Claims.php 9094 2008-03-30 18:36:55Z thomas $
|
||||
* @version $Id: Claims.php 13522 2009-01-06 16:35:55Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
* Zend_InfoCard_Exception
|
||||
*/
|
||||
require_once 'Zend/InfoCard/Exception.php';
|
||||
|
||||
/**
|
||||
* Result value of the InfoCard component, contains any error messages and claims
|
||||
* from the processing of an information card.
|
||||
@ -118,13 +113,10 @@ class Zend_InfoCard_Claims
|
||||
*/
|
||||
public function getDefaultNamespace()
|
||||
{
|
||||
|
||||
if(is_null($this->_defaultNamespace)) {
|
||||
|
||||
if($this->_defaultNamespace === null) {
|
||||
$namespaces = array();
|
||||
$leader = '';
|
||||
foreach($this->_claims as $claim) {
|
||||
|
||||
if(!isset($namespaces[$claim['namespace']])) {
|
||||
$namespaces[$claim['namespace']] = 1;
|
||||
} else {
|
||||
@ -137,6 +129,7 @@ class Zend_InfoCard_Claims
|
||||
}
|
||||
|
||||
if(empty($leader)) {
|
||||
require_once 'Zend/InfoCard/Exception.php';
|
||||
throw new Zend_InfoCard_Exception("Failed to determine default namespace");
|
||||
}
|
||||
|
||||
@ -163,6 +156,7 @@ class Zend_InfoCard_Claims
|
||||
}
|
||||
}
|
||||
|
||||
require_once 'Zend/InfoCard/Exception.php';
|
||||
throw new Zend_InfoCard_Exception("At least one claim must exist in specified namespace to make it the default namespace");
|
||||
}
|
||||
|
||||
@ -209,7 +203,8 @@ class Zend_InfoCard_Claims
|
||||
*/
|
||||
public function setClaims(Array $claims)
|
||||
{
|
||||
if(!is_null($this->_claims)) {
|
||||
if($this->_claims !== null) {
|
||||
require_once 'Zend/InfoCard/Exception.php';
|
||||
throw new Zend_InfoCard_Exception("Claim objects are read-only");
|
||||
}
|
||||
|
||||
@ -234,6 +229,7 @@ class Zend_InfoCard_Claims
|
||||
return $this;
|
||||
}
|
||||
|
||||
require_once 'Zend/InfoCard/Exception.php';
|
||||
throw new Zend_InfoCard_Exception("Attempted to set unknown error code");
|
||||
}
|
||||
|
||||
@ -279,6 +275,7 @@ class Zend_InfoCard_Claims
|
||||
*/
|
||||
public function __unset($k)
|
||||
{
|
||||
require_once 'Zend/InfoCard/Exception.php';
|
||||
throw new Zend_InfoCard_Exception("Claim objects are read-only");
|
||||
}
|
||||
|
||||
@ -304,6 +301,7 @@ class Zend_InfoCard_Claims
|
||||
*/
|
||||
public function __set($k, $v)
|
||||
{
|
||||
require_once 'Zend/InfoCard/Exception.php';
|
||||
throw new Zend_InfoCard_Exception("Claim objects are read-only");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user