Added new fields type

This commit is contained in:
Antonio de la Rosa 2015-04-21 04:23:56 +02:00
parent fce1896c8d
commit 0402ebebf0
6 changed files with 328 additions and 1902 deletions

View file

@ -0,0 +1,65 @@
<?php
/**
* Doublefield is a field for doubles values.
*/
namespace PhangoApp\PhaModels\CoreFields;
class DoubleField extends PhangoField {
public $size=11;
public $value=0;
public $label="";
public $required=0;
public $form="";
public $quot_open='\'';
public $quot_close='\'';
public $std_error='';
function __construct($size=11)
{
$this->size=$size;
$this->form='TextForm';
}
function check($value)
{
$this->value=form_text($value);
settype($value, "double");
return $value;
}
function get_type_sql()
{
return 'DOUBLE NOT NULL';
}
/**
* This function is used for show the value on a human format
*/
public function show_formatted($value)
{
return $value;
}
function get_parameters_default()
{
return array($this->name_component, '', 0);
}
}
?>