You meant drop the Zend Table altogether and just build normal queries?
I would hope that Zend Table would include the select options very soon.
Another query is how to I pull out the changed table names from the rowSet
i.e.
Zend_Db_Table::setDefaultAdapter($db);
$table = new Dataobjects__User();
$db = $table->getAdapter();
$where = $db->quoteInto('creation_date > ?', $calendar['day'])
. $db->quoteInto(' AND creation_Date <= ?',
$calendar['day'] + 86400);
$order = 'first_name';
$count = 0;
$offset = 20;
$rowSet = $table->fetchAll($where, $order, $count, $offset);
$fields = array('id', 'firstName', 'lastName', 'creationDate',
'status');
I specifically name the fields here - but would be nice to extract from the
rowSet but I am getting a protected notice on _table
Fatal error: Cannot access protected property Zend_Db_Table_Rowset::$_table
in D:\AWebEnvironment\htdocs\Athena\stats\controllers\IndexController.php on
line 76
This is useful info to get back so I can build up a similar thing to
PEAR:structures, has anyone bolted on PEAR structures to Zend Table or DB?
Any other hints on how to optimise database extraction and rendering please
send to me.
Cheers
Ian
> -----Original Message-----
> From: Art Hundiak [mailto:[EMAIL PROTECTED]
> Sent: 08 March 2007 18:43
> To: [email protected]
> Subject: Re: [fw-general] DB Table
>
> Ian,
>
> Might be better off just building a query with Zend_Db_Select. The manual
> has examples. Be aware that the .8 version of Zend_Db_Select is basically
> non-functional so use the .7 version.
>
> >
> > -- Ian Warner <[EMAIL PROTECTED]> wrote
> > (on Thursday, 08 March 2007, 05:56 PM -0000):
> >> That would be why then :)
> >>
> >> Been pulling my hair out for quite a while to solve this.
> >>
> >> So it is basically not possible to do a COUNT(*) etc or any
> >> functionality
> >> with the column selects
> >
> > Well, it is possible, just not using the class's find() and fetchAll()
> > methods.
> >
> > I have methods like the following in many of my Zend_Db_Table classes:
> >
> > public function fetchInfo($id)
> > {
> > $select = $this->select();
> > $select->from($this->_name, array('id', 'username', 'email'))
> > ->where('id = ?', $id);
> >
> > $row = $this->getAdapter()->fetchRow($select);
> > return $row;
> > }
> >
> > You don't end up with Zend_Db_TableRow|set results, but you do end up
> > getting the exact columns you desire -- and you can use constructs like
> > COUNT(*) in your from clause in your select object. I've found
> > Zend_Db_Table + Zend_Db_Select to be a very flexible, powerful
> > combination.
> >
> >> > -----Original Message-----
> >> > From: Bill Karwin [mailto:[EMAIL PROTECTED]
> >> > Sent: 08 March 2007 17:52
> >> > To: Ian Warner; Zend Framework General
> >> > Subject: RE: [fw-general] DB Table
> >> >
> >> > > From: Ian Warner [mailto:[EMAIL PROTECTED]
> >> > > Now I want to be able to adjust what columns are selected I cannot
> >> see
> >> > > this in the DB table code or in the documentation.
> >> >
> >> > Currently Zend_Db_Table selects all columns from the table.
> >> > It is currently a feature request to allow the app to specify which
> >> > columns it fetches. This is not implemented yet.
> >> >
> >> > http://framework.zend.com/issues/browse/ZF-694
> >> >
> >> > To be honest, I would have to say that it is not likely to be
> >> > implemented in the next release of Zend_Db.
> >
> > --
> > Matthew Weier O'Phinney
> > PHP Developer | [EMAIL PROTECTED]
> > Zend - The PHP Company | http://www.zend.com/
> >
> >
>