Daniia/Daniia.php
final public function select($select = "*") {
      $this->connection();
      if (func_num_args()>1)
         $select = func_get_args();
      else if(is_string($select)) {
         $select = [$select];
      }

      $select_tmp = [];
      foreach ($select as $value) {

         if ( $value===NULL )
            $select_tmp[] = ' NULL ';
         elseif ( gettype( $value )==='boolean' )
            $select_tmp[] = $value ? ' TRUE ' : ' FALSE ';
         elseif ($value instanceof \Closure) {
            $value(new \Daniia\Daniia());
            if (preg_match("/^CASE/", $_ENV['daniia_daniia']->case)) {
               $select_tmp[] = '( '.$_ENV['daniia_daniia']->case.' '.$_ENV['daniia_daniia']->when.' '.$_ENV['daniia_daniia']->else.' END )';
               $_ENV['daniia_daniia']->case = NULL;
            }
            else {
               $select_tmp[] = $_ENV['daniia_daniia']->get_sql();
               $_ENV['daniia_daniia'] = null;
            }
         }
         elseif ( in_array(strtolower(trim($value)), $this->columnsData, true) )
            $select_tmp[] = $value;
         else {
            $select_tmp[] = $value;
         }

      }

      $select = implode(",", $select_tmp);
      $this->select = str_replace("*", $select, $this->select);

      $this->find_first_data = $this->find_save_data = $this->find_delete_data = FALSE;

      $this->get_instance();
      return $this;
   }
final public function select($select = "*") {
      $this->connection();
      if (func_num_args()>1)
         $select = func_get_args();
      else if(is_string($select)) {
         $select = [$select];
      }

      $select_tmp = [];
      foreach ($select as $value) {

         if ( $value===NULL )
            $select_tmp[] = ' NULL ';
         elseif ( gettype( $value )==='boolean' )
            $select_tmp[] = $value ? ' TRUE ' : ' FALSE ';
         elseif ($value instanceof \Closure) {
            $value(new \Daniia\Daniia());
            if (preg_match("/^CASE/", $_ENV['daniia_daniia']->case)) {
               $select_tmp[] = '( '.$_ENV['daniia_daniia']->case.' '.$_ENV['daniia_daniia']->when.' '.$_ENV['daniia_daniia']->else.' END )';
               $_ENV['daniia_daniia']->case = NULL;
            }
            else {
               $select_tmp[] = $_ENV['daniia_daniia']->get_sql();
               $_ENV['daniia_daniia'] = null;
            }
         }
         elseif ( in_array(strtolower(trim($value)), $this->columnsData, true) )
            $select_tmp[] = $value;
         else {
            $select_tmp[] = $value;
         }

      }

      $select = implode(",", $select_tmp);
      $this->select = str_replace("*", $select, $this->select);

      $this->find_first_data = $this->find_save_data = $this->find_delete_data = FALSE;

      $this->get_instance();
      return $this;
   }
final public function select ( $ select = "*" ) { $ this -> connection ( ) ; if ( func_num_args ( ) > 1 ) $ select = func_get_args ( ) ; else if ( is_string ( $ select ) ) { $ select = [ $ select ] ; } $ select_tmp = [ ] ; foreach ( $ select as $ value ) { if ( $ value === NULL ) $ select_tmp [ ] = ' NULL ' ; elseif ( gettype ( $ value ) === 'boolean' ) $ select_tmp [ ] = $ value ? ' TRUE ' : ' FALSE ' ; elseif ( $ value instanceof \ Closure ) { $ value ( new \ Daniia \ Daniia ( ) ) ; if ( preg_match ( "/^CASE/" , $ _ENV [ 'daniia_daniia' ] -> case ) ) { $ select_tmp [ ] = '( ' . $ _ENV [ 'daniia_daniia' ] -> case . ' ' . $ _ENV [ 'daniia_daniia' ] -> when . ' ' . $ _ENV [ 'daniia_daniia' ] -> else . ' END )' ; $ _ENV [ 'daniia_daniia' ] -> case = NULL ; } else { $ select_tmp [ ] = $ _ENV [ 'daniia_daniia' ] -> get_sql ( ) ; $ _ENV [ 'daniia_daniia' ] = null ; } } elseif ( in_array ( strtolower ( trim ( $ value ) ) , $ this -> columnsData , true ) ) $ select_tmp [ ] = $ value ; else { $ select_tmp [ ] = $ value ; } } $ select = implode ( "," , $ select_tmp ) ; $ this -> select = str_replace ( "*" , $ select , $ this -> select ) ; $ this -> find_first_data = $ this -> find_save_data = $ this -> find_delete_data = FALSE ; $ this -> get_instance ( ) ; return $ this ; }
Establese los nombres dee las columnas a consultar
@author Carlos Garcia
@param string $select
@return Object
Establese los nombres dee las columnas a consultar