Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/03/2011, 10:56
Avatar de HiToGoRoShi
HiToGoRoShi
 
Fecha de Ingreso: abril-2008
Mensajes: 849
Antigüedad: 16 años
Puntos: 31
inicializar un constructor y retornar el objeto, MODELOS

Amigos miren, tengo este modelo

Código PHP:
Ver original
  1. <?php
  2. class BELUsuario extends Model
  3. {
  4.     private $cal_login;
  5.     private $cal_passwd;
  6.     private $cal_lastname;
  7.     private $cal_firstname;
  8.     private $cal_is_admin;
  9.     private $cal_email;
  10.     private $cal_enabled;
  11.     private $cal_telephone;
  12.     private $cal_address;
  13.     private $cal_title;
  14.     private $cal_birthday;
  15.     private $cal_last_login;
  16.     private $cal_typeuser;
  17.     private $cal_typeuseremp;
  18.    
  19.     public function __construct(){
  20.         parent::Model();
  21.     }
  22.    
  23.     /**
  24.      * @return the $cal_login
  25.      */
  26.     public function getCal_login ()
  27.     {
  28.         return $this->cal_login;
  29.     }
  30.     /**
  31.      * @return the $cal_passwd
  32.      */
  33.     public function getCal_passwd ()
  34.     {
  35.         return $this->cal_passwd;
  36.     }
  37.     /**
  38.      * @return the $cal_lastname
  39.      */
  40.     public function getCal_lastname ()
  41.     {
  42.         return $this->cal_lastname;
  43.     }
  44.     /**
  45.      * @return the $cal_firstname
  46.      */
  47.     public function getCal_firstname ()
  48.     {
  49.         return $this->cal_firstname;
  50.     }
  51.     /**
  52.      * @return the $cal_is_admin
  53.      */
  54.     public function getCal_is_admin ()
  55.     {
  56.         return $this->cal_is_admin;
  57.     }
  58.     /**
  59.      * @return the $cal_email
  60.      */
  61.     public function getCal_email ()
  62.     {
  63.         return $this->cal_email;
  64.     }
  65.     /**
  66.      * @return the $cal_enabled
  67.      */
  68.     public function getCal_enabled ()
  69.     {
  70.         return $this->cal_enabled;
  71.     }
  72.     /**
  73.      * @return the $cal_telephone
  74.      */
  75.     public function getCal_telephone ()
  76.     {
  77.         return $this->cal_telephone;
  78.     }
  79.     /**
  80.      * @return the $cal_address
  81.      */
  82.     public function getCal_address ()
  83.     {
  84.         return $this->cal_address;
  85.     }
  86.     /**
  87.      * @return the $cal_title
  88.      */
  89.     public function getCal_title ()
  90.     {
  91.         return $this->cal_title;
  92.     }
  93.     /**
  94.      * @return the $cal_birthday
  95.      */
  96.     public function getCal_birthday ()
  97.     {
  98.         return $this->cal_birthday;
  99.     }
  100.     /**
  101.      * @return the $cal_last_login
  102.      */
  103.     public function getCal_last_login ()
  104.     {
  105.         return $this->cal_last_login;
  106.     }
  107.     /**
  108.      * @return the $cal_typeuser
  109.      */
  110.     public function getCal_typeuser ()
  111.     {
  112.         return $this->cal_typeuser;
  113.     }
  114.     /**
  115.      * @return the $cal_typeuseremp
  116.      */
  117.     public function getCal_typeuseremp ()
  118.     {
  119.         return $this->cal_typeuseremp;
  120.     }
  121.     /**
  122.      * @param field_type $cal_login
  123.      */
  124.     public function setCal_login ($cal_login)
  125.     {
  126.         $this->cal_login = $cal_login;
  127.     }
  128.     /**
  129.      * @param field_type $cal_passwd
  130.      */
  131.     public function setCal_passwd ($cal_passwd)
  132.     {
  133.         $this->cal_passwd = $cal_passwd;
  134.     }
  135.     /**
  136.      * @param field_type $cal_lastname
  137.      */
  138.     public function setCal_lastname ($cal_lastname)
  139.     {
  140.         $this->cal_lastname = $cal_lastname;
  141.     }
  142.     /**
  143.      * @param field_type $cal_firstname
  144.      */
  145.     public function setCal_firstname ($cal_firstname)
  146.     {
  147.         $this->cal_firstname = $cal_firstname;
  148.     }
  149.     /**
  150.      * @param field_type $cal_is_admin
  151.      */
  152.     public function setCal_is_admin ($cal_is_admin)
  153.     {
  154.         $this->cal_is_admin = $cal_is_admin;
  155.     }
  156.     /**
  157.      * @param field_type $cal_email
  158.      */
  159.     public function setCal_email ($cal_email)
  160.     {
  161.         $this->cal_email = $cal_email;
  162.     }
  163. ...
  164. ...
  165. ..
  166. }

Mi gran pregunta es, como puedo inicialziar el constructor de esta clase, bueno el constructor no esta creado, pero me refiero cuando llamo al modelo como puedo inicialziar su constructor no hay forma

Ya que si lo hiciera asi $var = new MyClase(parametros); le pasaria los parametros ahi mismo, en CI como lo gro eso, y tambien como capturo el objeto, ya que ese objeto inicialziado se lo pase a mi capa de persistencia para que llene algun dato en la DB