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
0
votes
1 answer

Zend One To Many doesn't work

I was trying an example of one to many relationship in zend framework, but I can't get results. Here are the tables: UsersTable:
MBozic
  • 1,132
  • 1
  • 10
  • 22
0
votes
1 answer

Zend framework - db_table - wrong datatype being saved

I'm using the Zend_db_table insert() method and get an error. The error is because I receiving data from POST as a string but the datatype for the table column is float. So it creates error when I try to insert string type into float column. What's…
Owen
  • 7,347
  • 12
  • 54
  • 73
0
votes
2 answers

Zend framework - Zend_db_table_abtract select()

I want to use select() where I can get just one column without specifying the table name. (Table name is in the $_name var declared in my model.) I tried this: $select->columns('field'); .. but I get error of "No table has been specified for the…
Owen
  • 7,347
  • 12
  • 54
  • 73
0
votes
1 answer

A foreign key constraint fails with Zend_Db_Table

I have to tables and their SQL is as below: CREATE TABLE item ( itemID INTEGER UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, name VARCHAR(100) NOT NULL, price FLOAT NOT NULL, stock INTEGER NOT NULL ) ENGINE = InnoDB; CREATE TABLE salesrecord…
Trantor Liu
  • 8,770
  • 8
  • 44
  • 64
0
votes
1 answer

zend framework update with swap value expression

I try to make universal update / swap which would always switch active status. In SQL is simple: UPDATE contacts SET active = ABS( active - 1 ) WHERE id = .... Where active is small int / flag 0 or 1, so it always work. When I try to implement it…
bensiu
  • 24,660
  • 56
  • 77
  • 117
0
votes
1 answer

Extending classes that extend Zend_Db_Table_Row_Abstract

We are building an online payment system using Zend Framework and we try to design it to make it easier to add new payment systems. Currently we have an implementation for PayPal, but maybe we want to add other providers later too. We have a Payment…
0
votes
1 answer

Can Zend enforce foreign key constraints on a MyISAM table?

For instance if I have something like this: class Application_Model_DbTable_Events extends Zend_Db_Table_Abstract { protected $_name = 'events'; protected $_dependentTables = array('UsersEvents'); protected $_referenceMap = array( …
grm
  • 5,197
  • 5
  • 29
  • 35
0
votes
1 answer

Zend_Db_Table_Abstract::update() possible bug

I have this code $db = Zend_Db_Table_Abstract::getDefaultAdapter(); $users_table = new Application_Model_UserModel(); $result = $users_table->update(array( "confirmed" => 1, "key" => null ), array( $db->quoteInto("'type' = ?",…
Egidio Caprino
  • 553
  • 10
  • 18
0
votes
2 answers

how to fetch selected user details using join query in zend framework

Hi i am new to zend and mysql so please ignore if this is a silly ques. i have two tabels: users and user_cars. Now the user_cars table contains same user with multiple cars. i.e. if a user has three different cars, then the user_cars table contains…
Naphstor
  • 2,356
  • 7
  • 35
  • 53
0
votes
2 answers

Working with multiple objects of the same type (PHP)

What is the corecte way to handle with al lot objects of the same type? Example: When i get a list of notes from the database with zend framework i get a rowset which contains an array with note data. If the number of notes in the database is 20…
0
votes
1 answer

Extracting query parts through Zend_Db_Rowset

I am building a class that only receive a Zend_Db_Rowset throught its params and from that I can extract the related Zend_Db_Table using the $rowset->getTable() method. I was wondering if there is a way to get the order statement back from the table…
JF Dion
  • 4,014
  • 2
  • 24
  • 34
0
votes
1 answer

stuck whith Zend_Db_Tables

trying to working with Zend_Db_Tables task is to retrive data from 2 or may be 3 tables and return as json. code: public function getWorkerAction() { $request = $this->getRequest(); $workers = new table_1(); if (!$worker) { $res…
Subdigger
  • 2,166
  • 3
  • 20
  • 42
0
votes
1 answer

User id on creation keeps returning 0 and can't be used

I have a registration form which allows users to receive information about different countries they've selected through a multicheckbox. The countries from the list are also in a table and have an id. The way in which I'm designing this is the…
la_f0ka
  • 1,773
  • 3
  • 23
  • 44
0
votes
1 answer

Request seems to be processed but server returns error page

since I am using the ZendFramework again, I started to "extend" the QuickStart application. I use the ZendX jQuery component as View Helper. I have one Controller MonsterController this has two actions besides…
Julius F
  • 3,434
  • 4
  • 29
  • 44