Пример #1
0
 /**
  * This method returns a 
  * 
  * @param string $property The property to return
  */
 protected static function getProperties($property = null)
 {
     if (!is_null($property)) {
         if (!in_array($property, static::$properties)) {
             throw OutOfBoundsException('The property is not defined');
         }
         return self::$properties[$property];
     }
     return static::$properties;
 }
Пример #2
0
 public function __construct(array $params)
 {
     $params['type'] = strtolower($params['type']);
     switch ($params['type']) {
         case 'mysql':
         case 'pgsql':
             break;
         case 'postgresql':
             $params['type'] = 'pgsql';
             break;
         default:
             throw OutOfBoundsException('想定外のDBです');
     }
     $class = 'AttoDbo_Connection' . ucfirst($params['type']);
     if (!class_exists($class, false)) {
         require Atto::dir_atto_classes() . 'atto-dao' . DS . 'connection-' . $params['type'] . '.php';
     }
     $this->_con = new $class($params);
 }
Пример #3
0
 /**
  * [b]
  * Abort with fatal error. (Used as fallback for INPUT_DIRECT access.)
  *
  */
 function _disallow($data)
 {
     throw OutOfBoundsException("Direct \$_REQUEST[\"{$this->__varname}\"] is not allowed, add ->filter method, or change INPUT_DIRECT if needed.");
 }
Пример #4
0
 /**
  * Change the cursor posion. It's used with SeekableIterator.
  * @param  Mixed $position
  * @return void
  */
 public function seek($position)
 {
     if (!isset($this->data[$position])) {
         throw \OutOfBoundsException('Out of bounds error !');
     }
     $this->position = $position;
 }