<?php
use Phalcon\Validation;
use Phalcon\Http\Request;
use Phalcon\Validation\Validator\Email as EmailValidator;
use Phalcon\Validation\Validator\Uniqueness as UniquenessValidator;
class SpmContacto extends \Phalcon\Mvc\Model {
public $CONT_CODIGO;
public $CONT_CEDULA;
public $CONT_RUCIDE;
public $CONT_NOMBRE;
public $CON_ESTADO;
public $CONT_TELEFO;
public $CONT_DIRECC;
public $CONT_AREA;
public $CONT_CARGO;
public $CONT_TIPOXX;
public $CONT_EMAIL;
public $CONT_USUARIO;
public $CONT_CLAVE;
public $CONT_CLAVEE;
public $CONT_FECNACI;
public $CONT_FECINSC;
public $CONT_TIPOCODIGO;
/**
* Initialize method for model.
*/
public function initialize() {
$this->setSchema("SPOLS");
$this->hasMany('CONT_CODIGO', 'SPMREFERENCIA', 'CONT_CODIGO', array('alias' => 'SPMREFERENCIA'));
$this->hasMany('CONT_CODIGO', 'SPTDETALLE', 'CONT_CODIGO', array('alias' => 'SPTDETALLE'));
$this->hasMany('CONT_CODIGO', 'SPTENCABEZADO', 'CONT_CODIGO', array('alias' => 'SPTENCABEZADO'));
$this->keepSnapshots(true);
}
public function columnMap() {
return array( 'CONT_CODIGO' => 'CONT_CODIGO',
'CONT_CEDULA' => 'CONT_CEDULA',
'CONT_RUCIDE' => 'CONT_RUCIDE',
'CONT_NOMBRE' => 'CONT_NOMBRE',
'CON_ESTADO' => 'CON_ESTADO',
'CONT_TELEFO' => 'CONT_TELEFO',
'CONT_DIRECC' => 'CONT_DIRECC',
'CONT_AREA' => 'CONT_AREA',
'CONT_CARGO' => 'CONT_CARGO',
'CONT_TIPOXX' => 'CONT_TIPOXX',
'CONT_EMAIL' => 'CONT_EMAIL',
'CONT_USUARIO' => 'CONT_USUARIO',
'CONT_CLAVE' => 'CONT_CLAVE',
'CONT_CLAVEE' => 'CONT_CLAVEE',
'CONT_FECNACI' => 'CONT_FECNACI',
'CONT_FECINSC' => 'CONT_FECINSC',
'CONT_TIPOCODIGO' => 'CONT_TIPOCODIGO' );
}
public function validation()
{
$this->validate(
new UniquenessValidator(
[
'field' => 'CONT_CEDULA',
'message' => 'Sorry, That username is already taken',
]
)
);
if ($this->validationHasFailed() == true) {
return false;
}
}
public function getSource() {
return 'SPM_CONTACTO';
}
public static function find($parameters = null) {
return parent::find($parameters);
}
public static function findFirst($parameters = null) {
return parent::findFirst($parameters);
}
}