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

How to call a function of db table row class from a controller in zend framework?

I am trying to call a function exists in my dbtable row class ie Test.php.and I want to call it from my controller. My dbtable class is Tests. $obj=new Model_Test(); $obj->testFunction(); but it's not working and giving the below error. Notice:…
ehp
  • 2,495
  • 6
  • 29
  • 43
0
votes
1 answer

Using table aliasing with zend_db_table objects

Suppose I have a table: $someTable = new Zend_Db_Table ('sometable'); I know I can build a query using the table's literal name. $sel = $someTable -> select () -> from ('sometable', array ('col_foo', 'col_bar')) …
GordonM
  • 31,179
  • 15
  • 87
  • 129
0
votes
1 answer

Zend DB Table and Model one to one

I have class that representing model of user with foreign key with is id of picture . class Model_User extends Model_AbstractEntity { protected $u_id; protected $u_email; protected $u_firstname; protected $u_lastname; protected…
MarJano
  • 1,257
  • 2
  • 18
  • 39
0
votes
2 answers

ZendFramework - Why is $this->fetchRow() failing?

Why this database query failing? in my CentOS. Error/Exception: "Notice: Undefined variable: table in /var/www/html/-manager/application/controllers/IndexController.php on line 37 Fatal error: Call to a member function getAdapter() on a non-object…
user285594
0
votes
1 answer

ZendFramework - How to get Page ID Name

I have a table *sitepage_manageadmins* which contain: " user_id, page_id ". There is another table *sitepage_pages* which contain " page_id, title ". Im trying to render as dropdown ( select list ) in Zend_Form the user which is admin to relevant…
Seik
  • 41
  • 5
0
votes
2 answers

Zend_Db_Table Base table or view not found

I have taken over an application written with the use of the Zend MVC and Zend_Db_Table for DB access. I am trying to add a new table but get the error: Base table or view not found: 1146 Table 'maa_agencies.contact' doesn't exist However…
Zjoia
  • 176
  • 3
  • 16
0
votes
1 answer

Zend_ACL - Cannot use my current model with it, I think I'm doing MVC the wrong way here

I've just started using Zend_ACL to restrict access to certain controllers based on user roles. Its working pretty fine except however now I need to set it up so that users can only access their own records. For example my application allows people…
Ali
  • 7,353
  • 20
  • 103
  • 161
0
votes
2 answers

Is it possible to profile Zend_Table queries?

I'm looking for a way to profile queries which are performed internally by Zend_Table. For example, after you finish Quickstart course, how to profile all the queries that are performed ? I've tried to enable profiler from application.ini like this:…
Vitalii Lebediev
  • 632
  • 2
  • 10
  • 19
0
votes
1 answer

Zend Framework: Select the greatest number from table columns

How can I select the greatest number from table columns, exp. that is my table: id|name|views| 1|test|42| 2|test1|89| 3|test2|4| 4|test3|35| I need to select all values for row id 2, because views is most greatest number from…
Defense
  • 259
  • 4
  • 21
0
votes
0 answers

Merging calculations from different columns to get an average

I want to calculate the average fuel consumption for every car in my table. I have a spendforfuel table with IdCar, Odometer, Quantity fields. Odometer field is current mileage. Quantity are the litres consumed between the current mileage and last…
enenen
  • 1,967
  • 2
  • 17
  • 33
0
votes
1 answer

Set a value to null, when calling Zend_Db::update() and insert()

My question is the exact same as How to Set a Value to NULL when using Zend_Db However, the solution given in that question is not working for me. My code looks like the following. I call updateOper on the Model class when update is clicked on the…
user_stackoverflow
  • 734
  • 2
  • 10
  • 18
0
votes
1 answer

Notice: undefined index 'itemid' in foreach construct

I am new to PHP and Zend Framework. I met the error: Notice: Undefined index: itemid in C:\xampp\htdocs\blogshop\application\views\scripts\item\tops.phtml on line 58 I don't get why this error shows up. public function topsAction() //tops…
0
votes
1 answer

Translating this sql statement to Zend_Db_Table

I have this test query that works fine: select `name` from `Role` as rl, `UserRole` as ur WHERE rl.id = ur.roleId AND ur.userId = '1' result: 'test' I 'm trying to use Zend_Table to do the same thing but I seem to be doing it wrong. Here 's what I…
johnjohn
  • 4,221
  • 7
  • 36
  • 46
0
votes
1 answer

Zend How to update table value using own table field value

How to do this on Zend DB Table? Like, UPDATE location AS main SET main.parent_location = 28, main.description = CONCAT( (SELECT sub.description FROM wms_location AS sub WHERE sub.id_location=28), main.designation )…
Majinbibo
  • 159
  • 5
  • 17
0
votes
2 answers

Join with zend_db_table_abstract classes in Zend Framework

I have a module with two models that extend Zend_Db_Table_Abstract: class Departments_Model_Subpages extends Zend_Db_Table_Abstract { protected $_name = 'bktg_departments_subpages'; protected $_primary = 'id'; } class…
dbergunder
  • 57
  • 3
  • 13