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
2 answers

Zend DB fetchAll(): where as array

I'm confused as to why Zend_DB doesn't accept an array of WHERE clauses - or am I incorrect? I have made the following work around: $all = new ORM_Model_DbTable_Asset(); $wheres = array('id > 0', 'enabled' => 1); $all = $all->fetchAll(implode(' AND…
azz0r
  • 3,283
  • 7
  • 42
  • 85
1
vote
1 answer

CakePHP style database query results in Zend Framework using Zend_Db_Table?

If you have a complex SQL query involving many joins (for example returning Articles with their associated many to many Tags) is there anything in Zend Framework that will produce the lovely CakePHP style database results: Array ( [0] => Array …
1
vote
2 answers

left join in zend framework

I am new in ZF and i would like to left join a table named country on country.id=firm_dtl.firm_country $firmobj->fetchAll($firmobj->select($this)->where("firm_name like '$alpha%'")->order('firm_name')); How can i do this. I am trying with this code…
Bajrang
  • 8,361
  • 4
  • 27
  • 40
1
vote
2 answers

Zend Framework DbTable insert() inserting records twice

I have a controller action as follows public function reportcommentAction() { $comment_id = $this->getRequest()->comment_id; $blockedCommentTable = new Application_Model_DbTable_BlockedComments(); …
Mike Kelly
  • 186
  • 4
  • 11
1
vote
1 answer

What's the use Overriding Table Setup Methods?

In Zend Framework you can override table setup methods as explained here: http://framework.zend.com/manual/en/zend.db.table.html#zend.db.table.defining.setup My question is what is the use of this? Under what circumstances would this be used? It…
Yasser1984
  • 2,401
  • 4
  • 32
  • 55
1
vote
1 answer

Zend_Db_Table - inserts after delete in transaction duplicate entry error

I'm developing a system in which I have an entity 'program' which has some 'locations' via a link table. I'm using Zend Framework with Zend_Db_Table. location 1-----* programlocation *------1 program In my mapper I have a function save() which…
1
vote
2 answers

How to execute query in Zend framework

Thanks for previous replies I am execution "select Name from table_name where id=1"; . i saw some tutorials for getting data from the database, they mentioned $DB = new Zend_Db_Adapter_Pdo_Mysql($params); DB->setFetchMode(Zend_Db::FETCH_OBJ); and…
RAAAAM
  • 3,378
  • 19
  • 59
  • 108
1
vote
2 answers

Zend Framework: Select with join and PDO name param binding

I am using Zend Framework and have been trying to do a joined query and also use named param binding. Referencing from the two posts below. When I just do the join everything works. When I add the name binding then it gets this error: Message:…
Brandon
  • 320
  • 1
  • 4
  • 13
1
vote
2 answers

DBT encounters an error "'dbt_utils' is undefined"

Hello could anyone help me how to check this error message I'm encountering. previously it used to work but upon running dbt clean its not working anymore. Your response is highly appreciated. Thank you so much. Steps to recreate: dbt clean; dbt…
Harris
  • 115
  • 6
1
vote
1 answer

Zend DB Join 2 rows from same table

I have the following table. --------------------------------------------- check_id | action_id | user_id | dt | --------------------------------------------- 1 | 1 | 6 | 2011-09-17 | 2 | 1 | 6 |…
Stuiterbal
  • 457
  • 4
  • 11
1
vote
1 answer

Zend Db Table Abstract Manipulate select()

is there any chance to set a where statement on any select() request regarding a Zend Db Table Abstract Object? Example: We have 2 roles, 1 role 'admin' which is allowed to see all products and 1 role 'supplier' which is allowed to see only their…
frgtv10
  • 5,300
  • 4
  • 30
  • 46
1
vote
2 answers

Zend framework - Auth: additional validation

I want to check the user table for status=1 as extra validation. My getAuthAdapter() method looks like this: private function getAuthAdapter (){ $authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter()); …
Owen
  • 7,347
  • 12
  • 54
  • 73
1
vote
2 answers

managing multiple user specific dbadapter with Zend_Db_Table

I have a very quick question about how to utilise Zend_Db_Table with user specific database adapters. I have an application that has a meta table that contains all application data, such as user logins, lookup tables and the like. Each client has…
Grant Collins
  • 1,781
  • 5
  • 31
  • 47
1
vote
2 answers

Creating databases using Zend_Db_Adapter

I'm struggling with a part of my application where I am using Zend_Db_Adapter to create a database schema in mysql per client signup. I have a database script that contains all the DDL to create the tables, I then read the contents of the file and…
Grant Collins
  • 1,781
  • 5
  • 31
  • 47
1
vote
1 answer

Getting an exception in zend frame work

Fatal error: Uncaught exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'abc' in 'where clause'' in C:\xampp\htdocs\CLMS\library\Zend\Db\Statement\Pdo.php:234 Stack trace: #0…
user855287