Questions tagged [zend-db-table]

Object-oriented interface to database tables

The Zend_Db_Table class is an object-oriented interface to database tables. It provides methods for many common operations on tables. The base class is extensible, so you can add custom logic.

The Zend_Db_Table solution is an implementation of the Table Data Gateway pattern. The solution also includes a class that implements the Row Data Gateway pattern.

Official documentation

437 questions
4
votes
1 answer

Zend_Db_Table insert issue with large content

I've been using Zend Framework for quite a while now, but now I have an issue that's got me puzzled. I have a table (MySQL) with just 2 columns (id and msg). The id field is an auto increment value and the msg field is a longtext type. The following…
vinnie
  • 41
  • 1
4
votes
1 answer

Database Connection in Zend View Helper

Is it a good practice to use database mappers in Zend View Helper? Because in my case this helper is making me a box of
that keeps changing in real time and is to be shown in all the views there are in my application. I can not possibly give…
ShayanK
  • 1,243
  • 2
  • 13
  • 27
4
votes
2 answers

How to find all dates between two dates in Zend Framework Query

I need to find all dates between two dates; that is start date and end date. Here is my query but it is not doing what I need it to do. In my table I have column name date_created which is in format like this 2011-06-09 06:41:10. I want to remove…
Fawad Ghafoor
  • 6,039
  • 7
  • 41
  • 53
4
votes
1 answer

Zend Framework Quickstart Model constructor

using the ZF quickstart create model, as a basis for this topic. I would like to understand exactly what the __construct and the setOptions() method are supposed to be doing in this context. No matter how many times I bang on it, I'm just no getting…
RockyFord
  • 8,529
  • 1
  • 15
  • 21
4
votes
1 answer

Zend_Db_Table_Row: Why do I have to use createRow()?

I'm wondering why in Zend_Db you have to use the createRow method to get a new, empty Row object, rather than just instantiating the Row object directly. For instance, if I've extended the default classes to create my own User table and row classes,…
Brian Lacy
  • 18,785
  • 10
  • 55
  • 73
4
votes
4 answers

Zend Framework: How to unset data rows in a Zend_Db_Table_Rowset object

I would like to iterate over the data rows stored in a Zend_Db_Table_Rowset object and then drop/unset some of the rows, if they don't fulfil certain criteria. I could use toArray() to get only the data rows from the object and then it would be easy…
markus
  • 40,136
  • 23
  • 97
  • 142
4
votes
2 answers

How do left outer joins work on Zend framework

I have this SQL query: SELECT pais FROM pais LEFT OUTER JOIN users_has_pais ON pais.id = users_has_pais.pais_id WHERE users_has_pais.users_id = 100 And I'm trying to write something similar within a model using the leftJoin method from…
la_f0ka
  • 1,773
  • 3
  • 23
  • 44
4
votes
2 answers

How to paginate two tables in zend framework

Books has the following fields book_id book_name book_auther book_pub_date category table has category_id category_name placement table has placement_id placement_category_id(FK) placement_book_id(FK) Now we want to use pagination in index…
3ehrang
  • 619
  • 1
  • 7
  • 22
4
votes
4 answers

Why am I getting this Strict Standards message?

I have created a Zend Framework model by extending Zend_Db_Table_Absract as follows (simplified example): class Foos extends Zend_Db_Table_Abstract { protected $_schema = 'Foo'; protected $_name = 'Foos'; protected $_primary = 'id'; …
karim79
  • 339,989
  • 67
  • 413
  • 406
4
votes
3 answers

Getting data from multiple tables when using the Zend framework?

Is there a best practice in getting data from multiple database tables using Zend? I would like to know rather than end up wanting to refactor the code I write in the near future. I was reading the Zend documentation and it said that: "You can not…
olive
  • 1,194
  • 1
  • 15
  • 34
4
votes
2 answers

Getting table object(App_Model_TableName) as fetch result (Zend Framework)

Right now, I'd wrote a function in my model as: public function getRowsByZipCode($zip) { // SQL to get all the rows with the given zip code $stmt = $this -> getAdapter() -> query( "SELECT * …
Pushpendra
  • 4,344
  • 5
  • 36
  • 64
4
votes
2 answers

Zend Framework: How to find a table row by the value of a specified column?

I am implementing my model exactly like the quickstart guide. In my model I am trying to implement a findByToken() method. The current find() method accepts an $id parameter, but I want to find by the value of a different column. //excerpt from the…
Andrew
  • 227,796
  • 193
  • 515
  • 708
4
votes
5 answers

zf2 make a join between two different databases

I am trying to make a join between two tables placed in different databases with Zend Framework 2. The first table is called users and is stored in the database admin The second table is called hierarchy and is stored in the database customer I load…
ivan.garcia
  • 41
  • 1
  • 2
4
votes
2 answers

zend relationships with select

I am new to zend. I have been asked to redevelop a website that was once written in plain PHP and put it into the zend framework. I am having a lot of trouble with database relationships, I cant seem to get my head round defining and querying…
user138095
4
votes
2 answers

array to Zend_Db_Table_Row zend framework

is there a way of automatic converting from array to Zend_Db_Table_Row or Zend_Db_Table_Rowset? Form Zend_Db_Table_Row you can get the array with toArray(), but I was wondering if there exits anything like opposite of that? Till now I have been…
Granit Luzhnica
1 2
3
29 30