Fixes in fields and mysqlclass

This commit is contained in:
Antonio de la Rosa 2016-07-05 02:31:31 +02:00
parent ecbaec5bbb
commit c3ccbb16e0
4 changed files with 29 additions and 6 deletions

View file

@ -15,8 +15,8 @@ class BooleanField extends PhangoField {
public $label=""; public $label="";
public $required=0; public $required=0;
public $form=""; public $form="";
public $quot_open='\''; public $quot_open='';
public $quot_close='\''; public $quot_close='';
public $std_error=''; public $std_error='';
public $default_value=0; public $default_value=0;
public $text_yes=''; public $text_yes='';

View file

@ -61,6 +61,10 @@ class SerializeField extends PhangoField {
} }
} }
else
{
$value=[];
}
return $value; return $value;

View file

@ -43,10 +43,10 @@ class SQLClass {
return $query; return $query;
} }
static public function webtsys_affected_rows( $idconnection , $server_data='default') static public function webtsys_affected_rows( $server_data='default' )
{ {
$num_rows = mysqli_affected_rows(Webmodel::$connection[$server_data], $idconnection ); $num_rows = mysqli_affected_rows(Webmodel::$connection[$server_data]);
return $num_rows; return $num_rows;
} }

View file

@ -703,6 +703,13 @@ class Webmodel {
$args=$conditions[1]; $args=$conditions[1];
if(gettype($args)!=='array')
{
throw new \Exception('Error: you need an array how second parameter');
}
} }
else else
{ {
@ -1488,6 +1495,18 @@ class Webmodel {
} }
/** /**
* A helper method used for get number of affected rows of a last sql operation
*
*/
public function affected_rows()
{
return SQLClass::webtsys_affected_rows($this->db_selected);
}
/**
* A helper function for obtain an array from a result of $this->select * A helper function for obtain an array from a result of $this->select
* *
* @param mixed $query The result of an $this->select operation * @param mixed $query The result of an $this->select operation