3
* KumbiaPHP web & app Framework
7
* This source file is subject to the new BSD license that is bundled
8
* with this package in the file LICENSE.txt.
9
* It is also available through the world-wide-web at this URL:
10
* http://wiki.kumbiaphp.com/Licencia
11
* If you did not receive a copy of the license and are unable to
12
* obtain it through the world-wide-web, please send an email
13
* to license@kumbiaphp.com so we can send you a copy immediately.
15
* Realiza validacion para campo con valor no nulo
18
* @package ActiveRecord
19
* @subpackage Validators
20
* @copyright Copyright (c) 2005-2010 Kumbia Team (http://www.kumbiaphp.com)
21
* @license http://wiki.kumbiaphp.com/Licencia New BSD License
23
class NotNullValidator implements ValidatorInterface
28
* @param ActiveRecord $object objeto ActiveRecord
29
* @param string $column nombre de columna a validar
30
* @param array $params parametros de configuracion
31
* @param boolean $update indica si es operacion de actualizacion
34
public static function validate($object, $column, $params = NULL, $update = FALSE)
36
if(!isset($object->$column) || Validate::isNull($object->$column)) {
37
if($params && isset($params['message'])) {
38
Flash::error($params['message']);
40
Flash::error("El campo $column no debe ser Nulo");