Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-23-2008, 07:35 PM
Junior Member
 
Join Date: Mar 2008
Posts: 3
Default Question about the use of Zend_Db_Table_abstract

Hello Everyone,


I was reading throug a zend presentation about using Zend_Db_... in combination with the MVC concept. This is the presentation i'm talking about: Zend Framework + Database Database Access - Fullscreen

I am currently playing around to implement this concept myself.

What I understand that i need to do is:
PHP Code:
class person extends Zend_Db_Table_Abstract{} 
Now I can use something like:

PHP Code:
$pers = new person($db);
$allPers $pers->find(123); 
Why can't i do that from within my class person. To define a function selectOne() or something like that. I don't want to access my db with queries from within my controller.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-24-2008, 07:39 PM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 119
Default

You can do that from class.

PHP Code:
class person extends Zend_Db_Table_Abstract
{
    protected 
$_name 'person_table-name';

That should allow $pers->find(123); to work.
__________________
Zend Framework Resources: Zend Webinars | Reference Manual | API Docs | Books | FreeNode: #zftalk
Getting Started Tutorials: Getting started with ZF | Getting started with Zend Auth
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:05 AM.