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
1
vote
1 answer

Zend db table find just like fetchRow

I´m using find() to retrieve a value from the database, but It returns an array with the objects, I would like that it return to me just the object like fetchRow returns, is there any change or similar thing to do? Thanks, and best regard´s.
digoferra
  • 1,001
  • 3
  • 17
  • 33
1
vote
1 answer

Zend Db Library: How to delete multiple rows with different contraints?

Is it possible to generate that SQL without hacking? DELETE FROM product WHERE (type=1 AND deleted=1) OR (type=2 AND category=10);
Anıl Özselgin
  • 420
  • 1
  • 4
  • 9
1
vote
1 answer

How to write a custom row class (extends Zend_Db_Table_Row) for a Db_Table class in Zend Framework

I have separate db_table classes for books, book_sections and users (system end users). in book table has columns for book_title, section_id(book_section) , data_entered_user_id(who entered book info). go to this url to see the image(I'm not allow…
knodumi
  • 2,747
  • 3
  • 16
  • 7
1
vote
2 answers

Zend Db Table Abstract fetchRow add new objects to it

I have a fetchRow, that is done like it: $db = new Database(); $data = $db->fetchRow($db->select()->where('id = ?',$id)); Done it, I would like to retrieve all the files from the file table, like this: $files = new Database(); $photos =…
digoferra
  • 1,001
  • 3
  • 17
  • 33
1
vote
1 answer

Zend_Db : Retaining \n (newline) characters for output

I am building an application based on the Zend Framework, and my issue is that whenever I grab data from the database (from inside the respective model class) using the fetchAll() method, despite the fact that \n characters are stored in the…
machinemessiah
  • 424
  • 1
  • 5
  • 14
1
vote
1 answer

Zend_Db using join in model

I want to show columns of two tabels which are in relation. My models looks as follows: class Application_Model_DbTable_Ribadocsveranstaltung extends Zend_Db_Table_Abstract { protected $_name = 'riba_docs'; protected $_primary =…
pia-sophie
  • 505
  • 4
  • 21
1
vote
2 answers

How to use data from Zend_Db_Table in a Zend_Form

I have create a form class for editing deleting and add users to a database. If I want to edit a user how can I simply supply the information of the user to the form. I use a Zend_Db_Table to get the data from the database. This is the userForm…
Solid Rhino
  • 1,685
  • 5
  • 18
  • 22
1
vote
1 answer

ZF2 - Join with TableGateway inside Model Table

How can I do a JOIN inside a Model Table with TableGateway? I have this in my Model/NoticiasTable.php: protected $tableGateway; public function __construct(TableGateway $tableGateway) { $this->tableGateway = $tableGateway; } public…
1
vote
1 answer

Zend Framework - Problem with Database Table Recursive Cascading Deletes

My situation may be a bit abnormal, but I have foreign keys defined in my MySQL database, while enforcing referential integrity in the Zend_Db_Table classes. The tables use the InnoDB storage engine. When deleting a record, the Zend Framework will…
1
vote
2 answers

Zend Framework 1 SQL query Where

Is there any way to do something like this: SELECT * FROM table WHERE p1=1 AND p2=2 AND ( p3 like %string1% OR p3 like %string3% ) In Zend Framework 1 by Zend_Db_Select or something else ?
ViktarV
  • 11
  • 2
1
vote
2 answers

Zend_Db_Select where() and Zend_Db_Adapter quoteInto()

Are Zend_Db_Select's where() method, when including the optional value to quite into, and Zend_Db_Adapte's quoteInto() methods basically the same as far as escaping SQL? In other words, are these two pieces of quote identical and equally…
Chris
  • 11
  • 2
1
vote
1 answer

Zend Framework Relationships - findDependentRowset

When I call the method findDependentRowset, the returning rowset contains all the rows in the dependent table, and not only the rowsets that matches the reference. Hoping someone could explain this, since I was of the assumption that…
1
vote
0 answers

Getting Fatal error: 'Configuration array must have a key for 'dbname' that names the database instance'

I want to get query from multi databases ,I'm trying to connection two databases (database1,database2) I've define application.ini: resources.multidb.db1.adapter = "PDO_MYSQL" resources.multidb.db1.params.host =…
1
vote
1 answer

Zend Framework 2 database connection issue

I am used ZF2 for creating new applications. We have some issue regarding db connection under controller and model file. We have put all database credential in "global.php" and "db.local.php" and also fetch db adapter access in our "Module.php" file…
1
vote
1 answer

Zend paginator running very slow 1.12

I am using zend paginator for fetching records and listing the same. There are four joins and I have indexed all the respective fields and I am getting only the required fields for listing in all the tables. Total number of records might be 5…