"Adding columns to an existing FROM" Fatal error!

View: New views
6 Messages — Rating Filter:   Alert me  

"Adding columns to an existing FROM" Fatal error!

by Benjamin.Gonzales :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I was trying the method columns, but I get error,



$select = $db->select()
   ->from(array('t1' => 'employee'), 'employee_id')
    ->columns('name');

I am doing wrong?
------------------------------------------------ERROR---------------------------------------------------
Fatal error: Uncaught exception 'Zend_Db_Select_Exception' with message 'Unrecognized method 'columns()''

in /Zend_library/ZendFramework-1.5.2/Zend/Db/Select.php:1086 Stack trace: #0

[internal function]: Zend_Db_Select->__call('columns', Array) #1

/appweb/application/modules/cms/controllers/EmployeeController.php(18): Zend_Db_Select->columns('emp_id', 'a1a') #2

/Zend_library/ZendFramework-1.5.2/Zend/Controller/Action.php(502): EmployeeController->indexAction() #3

/Zend_library/ZendFramework-1.5.2/Zend/Controller/Dispatcher/Standard.php(293): Zend_Controller_Action->dispatch('indexAction') #4

/Zend_library/ZendFramework-1.5.2/Zend/Controller/Front.php(914): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #5

/appweb/library/Gnbit/Init.php(199): Zend_Controller_Front->dispatch() #6

/var in /Zend_library/ZendFramework-1.5.2/Zend/Db/Select.php on line 1086

Re: "Adding columns to an existing FROM" Fatal error!

by ah125i :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
There does not seem to be a method columns either in the api or in Zend_Db_Select file
I have tested the function :
public function columns($cols, $correlationName=null) {
        $this->_tableCols($correlationName, $cols);
        return $this;
    }
and it works successfully when added to Zend_Db_Select.  I am not intimately familiar this this class, however this function should provide you with the basic functionality you are looking for.

Thanks!

Benjamin.Gonzales wrote:
I was trying the method columns, but I get error,

$select = $db->select()
   ->from(array('t1' => 'employee'), 'employee_id')
    ->columns('name');

I am doing wrong?

Re: "Adding columns to an existing FROM" Fatal error!

by Simon Mundy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there

The 'columns' method has been added to the trunk - you should see this  
in the 1.6 stable release.

Kind regards

> Hi,
> There does not seem to be a method columns either in the api or in
> Zend_Db_Select file
> I have tested the function :
> public function columns($cols, $correlationName=null) {
>        $this->_tableCols($correlationName, $cols);
>        return $this;
>    }
> and it works successfully when added to Zend_Db_Select.  I do am not
> intimately familiar this this class, this function should provide  
> you with
> the basic functionality you are looking for however.
>
> Thanks!
>
> Benjamin.Gonzales wrote:
>>
>> I was trying the method columns, but I get error,
>>
>> $select = $db->select()
>>   ->from(array('t1' => 'employee'), 'employee_id')
>>    ->columns('name');
>>
>> I am doing wrong?
>>
> --
> View this message in context: http://www.nabble.com/%22Adding-columns-to-an-existing-FROM%22-Fatal-error%21-tp17994451p17995443.html
> Sent from the Zend DB mailing list archive at Nabble.com.

--

Simon Mundy | Director | PEPTOLAB

""" " "" """""" "" "" """"""" " "" """"" " """"" "  """""" "" "

202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654  
4124
http://www.peptolab.com


Re: "Adding columns to an existing FROM" Fatal error!

by Benjamin.Gonzales :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You're right, the method exists in the trunk, but is not found in version 1.5.2 for download.
It should hide the "method columns" of the manual 

until the publication of the new version.

Re: "Adding columns to an existing FROM" Fatal error!

by Ondr(ej FlĂ­dr :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Simon Mundy napsal(a):
> Hi there
>
> The 'columns' method has been added to the trunk - you should see this
> in the 1.6 stable release.
>
Maybe it should be marked as "not in stable release" in documentation in
Zend_Db_Select page, cause there is no note about it, everything looks
like this method is available in stable release.

Re: "Adding columns to an existing FROM" Fatal error!

by Simon Mundy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yep, we've run into this issue before (documentation in trunk being  
added before a stable release). Will work out the best resolution for  
this.

Thanks for the feedback

>
> Simon Mundy napsal(a):
>> Hi there
>>
>> The 'columns' method has been added to the trunk - you should see  
>> this in the 1.6 stable release.
>>
> Maybe it should be marked as "not in stable release" in  
> documentation in Zend_Db_Select page, cause there is no note about  
> it, everything looks like this method is available in stable release.

--

Simon Mundy | Director | PEPTOLAB

""" " "" """""" "" "" """"""" " "" """"" " """"" "  """""" "" "

202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654  
4124
http://www.peptolab.com

LightInTheBox - Buy quality products at wholesale price