Location: PHPKode > scripts > DATA > data/DATA/SQLVarcharFactory.php
<?php
/**
 * @package DATA
 */

/**
 * A concrete factory for inboxing strings into varchar fields.
 */
class DATA_SQLVarcharFactory extends DATA_SQLCharFactory {
    /**
     * Inboxes a value.
     * 
     * Throws {@link DATA_StringTooLarge}.
     * 
     * @param mixed $value The value.
     * @return DATA_SQLVarchar Inboxed value.
     */
    public function inbox($value) {
        if ($value instanceof DATA_SQLVarchar) {
            if ($this->nullable == $value->isNullable()
             && $value->getSize() == $this->size) {
                return clone $value;
            }
        }
        if ($value instanceof DATA_SQLType) {
            $value = $value->outbox();
        }
        if (!is_null($value)) {
            $value = (string)$value;
        }
        return new DATA_SQLVarchar($this->nullable, $this->size, $value);
    }
}
?>
Return current item: DATA