public function GetByCriteria($objectclass, $criteria, $crash_if_multiple_found = true, $cache_timeout = null)
	{
		if (is_null($cache_timeout)) $cache_timeout = $this->ValueCacheTimeout;

		if (strlen($objectclass) < 1)
		{
			throw new Exception("\$objectclass argument is required");
		}

		$obj = null;
		$objs = $this->Query($objectclass, $criteria, $cache_timeout)->ToObjectArray();

		if (count($objs) == 0)
		{
			require_once("NotFoundException.php");
			throw new NotFoundException("$objectclass with specified criteria not found");
		}

		if ($crash_if_multiple_found && count($objs) > 1)
		{
			throw new Exception("More than one $objectclass with specified criteria was found");
		}
		
		$obj = $objs[0];

		return $obj;
	}
public function GetByCriteria($objectclass, $criteria, $crash_if_multiple_found = true, $cache_timeout = null)
	{
		if (is_null($cache_timeout)) $cache_timeout = $this->ValueCacheTimeout;

		if (strlen($objectclass) < 1)
		{
			throw new Exception("\$objectclass argument is required");
		}

		$obj = null;
		$objs = $this->Query($objectclass, $criteria, $cache_timeout)->ToObjectArray();

		if (count($objs) == 0)
		{
			require_once("NotFoundException.php");
			throw new NotFoundException("$objectclass with specified criteria not found");
		}

		if ($crash_if_multiple_found && count($objs) > 1)
		{
			throw new Exception("More than one $objectclass with specified criteria was found");
		}
		
		$obj = $objs[0];

		return $obj;
	}
public function GetByCriteria ( $ objectclass , $ criteria , $ crash_if_multiple_found = true , $ cache_timeout = null ) { if ( is_null ( $ cache_timeout ) ) $ cache_timeout = $ this -> ValueCacheTimeout ; if ( strlen ( $ objectclass ) < 1 ) { throw new Exception ( "\$objectclass argument is required" ) ; } $ obj = null ; $ objs = $ this -> Query ( $ objectclass , $ criteria , $ cache_timeout ) -> ToObjectArray ( ) ; if ( count ( $ objs ) == 0 ) { require_once ( "NotFoundException.php" ) ; throw new NotFoundException ( "$objectclass with specified criteria not found" ) ; } if ( $ crash_if_multiple_found && count ( $ objs ) > 1 ) { throw new Exception ( "More than one $objectclass with specified criteria was found" ) ; } $ obj = $ objs [ 0 ] ; return $ obj ; }
Get one instance of an object based on criteria.  If multiple records
are found, only the first is returned.  If no matches are found,
an exception is thrown

@access public
@param string $objectclass the type of object that will be queried
@param Criteria $criteria a Criteria object to limit results
@param bool $crash_if_multiple_found default value = true
@param int cache timeout (in seconds).  Default is Phreezer->ValueCacheTimeout.  Set to 0 for no cache
@return Phreezable
Get one instance of an object based on criteria . If multiple records are found only the first is returned . If no matches are found an exception is thrown