Added modelform and model extensions

This commit is contained in:
Antonio de la Rosa 2015-04-28 22:14:54 +02:00
parent ac0b0f5e5a
commit 7b7df55b3b
12 changed files with 1102 additions and 0 deletions

View file

@ -0,0 +1,40 @@
<?php
/**
*
* @author Antonio de la Rosa <webmaster@web-t-sys.com>
* @file
* @package Core/ModelExtraMethods
*
*
*/
/**
* Extension method class used for select a field only of the model in the db
*
* This method is useful if you only want load a field of a model.
*
* @param Webmodel $class The model used for search in
* @param string $where A where sql statement.
* @param string $field The field where search.
*/
function select_a_field_method_class($class, $where, $field)
{
$arr_field=array();
$query=$class->select($where, array($field), $raw_query=1);
while(list($field_choose)=webtsys_fetch_row($query))
{
$arr_field[]=$field_choose;
}
return $arr_field;
}
?>