PHP Classes
Icontem

File: DATA/StringTooLarge.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Martin Alterisio  >  DATA  >  DATA/StringTooLarge.php  
File: DATA/StringTooLarge.php
Role: Class source
Content type: text/plain
Description: An exception thrown when a sql character field cannot hold the string provided by the user.
Class: DATA
Access data stored in MySQL tables like arrays
 

Contents

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

/**
 * An exception thrown when a sql character field cannot hold
 * the string provided by the user.
 */
class DATA_StringTooLarge extends DATA_SQLTypeConstraintFailed {
    
/**
     * The maximum size that was expected.
     * @var int
     */
    
private $expectedSize;
    
/**
     * The string that failed the constraint.
     * @var string
     */
    
private $providedString;
    
    
/**
     * Constructor.
     * 
     * @param int $expectedSize The maximum size that was expected.
     * @param string $providedString The string that failed the constraint.
     */
    
public function __construct($expectedSize$providedString) {
        
parent::__construct("SQL char field of $expectedSize characters cannot hold '$providedString'");
        
$this->expectedSize $expectedSize;
        
$this->providedString $providedString;
    }
    
    
/**
     * Returns the maximum size expected.
     * 
     * @return int Maximum size expected.
     */
    
public function getExpectedSize() {
        return 
$this->expectedSize;
    }
    
    
/**
     * Returns the string that failed the constraint.
     * 
     * @return string String that failed the constraint.
     */
    
public function getProvidedString() {
        return 
$this->providedString;
    }
}
?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products