PHP Classes

File: DATA/InvalidInt.php

Recommend this page to a friend!
  Classes of Martin Alterisio   DATA   DATA/InvalidInt.php   Download  
File: DATA/InvalidInt.php
Role: Class source
Content type: text/plain
Description: An exception thrown when a sql int field is filled with an invalid value or has overflown its capacity.
Class: DATA
Access data stored in MySQL tables like arrays
Author: By
Last change: + anonymous access
Date: 17 years ago
Size: 884 bytes
 

Contents

Class file image Download
<?php
/**
 * @package DATA
 */

/**
 * An exception thrown when a sql int field is filled with an
 * invalid value or has overflown its capacity.
 */
class DATA_InvalidInt extends DATA_SQLTypeConstraintFailed {
   
/**
     * The value that failed the constraint.
     * @var mixed
     */
   
private $providedValue;
   
   
/**
     * Constructor.
     *
     * @param mixed $providedValue The value that failed the constraint.
     */
   
public function __construct($providedValue) {
       
parent::__construct("SQL int field cannot hold '$providedValue'");
       
$this->providedValue = $providedValue;
    }
   
   
/**
     * Returns the value that failed the constraint.
     *
     * @return mixed The value that failed the constraint.
     */
   
public function getProvidedValue() {
        return
$this->providedValue;
    }
}
?>