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 Framework MySQL query() problem with inserting long text

I have a class: class Content_IndexModel extends Zend_Db_Table_Abstract {} and I want to insert new row into some table using: $this->getAdapter()->query(); (I can't use insert() method because I need to put "ON DUPLICATE KEY UPDATE ...") Query…
Marek
  • 2,681
  • 3
  • 22
  • 18
1
vote
1 answer

zend_db_table how do i select all distinct values for a specific column

Hi guys i believe this could turn out to be trivial but i have the following code $response = $groupsmapper->getDbTable()->fetchAll( $groupsmapper->getDbTable()->select('group_area_residence') ->distinct() which is…
Napoleon
  • 879
  • 2
  • 14
  • 36
1
vote
2 answers

Zend Framework get dependent rows following a certain condition

I want to retrieve rows from a dependent table that follows a given criteria in the dependent table.
1
vote
1 answer

Insert a time + n in mySQL using Zend_db_table!

$data = array ( 'next' => "NOW() + 5", 'interval' => $dom["USER"][0]["STATUSES_COUNT"][0]["data"], 'good' => $good, 'tries' => $p->tries + 1 ); …
DFectuoso
  • 4,877
  • 13
  • 39
  • 55
1
vote
2 answers

Zend Framework with multiple schema/databases?

I have a few tables that I've defined like the below examples: class TableA extends Zend_Db_Table_Abstract { protected $_schema = 'schema1'; protected $_name = 'tablea'; } class TableB extends Zend_Db_Table_Abstract { …
leek
  • 11,803
  • 8
  • 45
  • 61
1
vote
3 answers

Zend 2: SQLSRV: $prepareParams is not being set

Can somebody explain me where the ->setPrepareParams(array $prepareParams) is called in Zend\Db\Adapter\Driver\Sqlsrv\Statement.php? Specifically, when I used this: $this->tableGateway->select(array("Personalnummer = $personalnumber")); It…
1
vote
1 answer

Zend Db Table delete() not working properly

I have the following code: $time = 60 * 60 * 24 * 3; $usersTable = new Application_Model_Db_Users(); $where = 'active = false AND registration_time < ' . time() - $time; $usersTable->delete($where); But when it is run it deletes all the rows in…
moteutsch
  • 3,741
  • 3
  • 29
  • 35
1
vote
1 answer

Indexing Adds/Changes not working using Lucene in Zend Framework

I am pretty new to programming and definitely to Zend/Lucene indexing. From what I can tell, though, my code is correct. I feel like I may be overlooking a step or something trying to upload changes and adds to the database so that they appear in…
1
vote
1 answer

zend retriving tag list

I have some problem with zend. Here it is. I'm going to make some kind of articles db, which containt some info. Every article is marked with 1 or more tags (like WordPress). I have a controller (let it be index) and action (also index). All I need…
Fluffy
  • 11
  • 2
1
vote
2 answers

zend db sql where with other wheres

I want to use some thing likes this: SELECT * FROM table WHERE NOT(other where); Other wheres are like A = 1 AND B = 3 Values of A and B are not static. How can I use zend-db to get this query? $where->addPredicate(new PredicateExpression('NOT…
1
vote
1 answer

Zend framework album example

Hi I am getting the following error in zendframework 2 in album example. Using PHP 5.6.2 version with XAMPP. Any clue for this issue.. Zend\ServiceManager\Exception\ServiceNotFoundException File: …
1
vote
1 answer

$_referenceMap Relationships with Zend_Db_Table_Abstract creates too many queries

This is my first time using Zend Framework for an application and i don't know if I completely have by head around Models. I have four tables: shopping_cart, product, product_unit, distributor. shopping cart has an cart_id, product_id, unit_id and…
marko.vujo
  • 101
  • 1
  • 6
1
vote
1 answer

How do I quickly create a complex select query using Zend_Db?

Let's say have something like: SELECT energy_produced, energy_consumed, timestamp1 AS timestamp FROM ( SELECT max(energy_produced) AS energy_produced, mid(timestamp, 1, 10) AS timestamp1 FROM tbl_energy WHERE site_id = 1366 AND mid(timestamp, 1,…
rg88
  • 20,742
  • 18
  • 76
  • 110
1
vote
1 answer

zend framework select join error getTable()

I am trying to implement this method in my model: class Application_Model_MenuProfilesProducts extends Zend_Db_Table_Abstract { protected $_name = 'menu_profiles_products'; public function fetchProducts($profileID) { $select =…
user253530
  • 2,583
  • 13
  • 44
  • 61
1
vote
1 answer

Get maximum value with Zend_Db_Table

Ive got a Zend_Db_Table Now I want to get the maximum available value of a field. Is there a way to get the MAX(number) value or do I need to use basic SQL? Thanks!
baklap
  • 2,145
  • 6
  • 28
  • 41