2017 © Pedro Peláez
 

library dzend

A set of classes to wrap around Zend v1. It' goal is to make common patterns easier to implement and to transparently add commonly used functionalities.

image

dmelo/dzend

A set of classes to wrap around Zend v1. It' goal is to make common patterns easier to implement and to transparently add commonly used functionalities.

  • Friday, December 23, 2016
  • by dmelo
  • Repository
  • 1 Watchers
  • 1 Stars
  • 103 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

DZend

DZend is a set of classes to wrap around Zend. It' goal is to make common patterns easier to implement and to transparently add commonly used functionalities., (*1)

If a Zend class is wrapped at DZend, then it's name will be the same as the Zend class but with a D at the beginning, but there is no abstract tables at DZend. For instance, DZend_Db_Table extends Zend_Db_Table_Abstract., (*2)

Prerequisite

PHP 5.4 >=, (*3)

Bootstrap

The bootstrap instantiate a few commonly used tools., (*4)

Logger

Instantiate Zend_Log and write it on registry. To access this instance just call:, (*5)

Zend_Registry::get('looger');

All the logs will be written on the file public/tmp/log.txt., (*6)

Internationalization

A Zend_Translate instance is already included on the registry translate. Similarly to the logger, to access the translate object, call:, (*7)

Zend_Registry::get('translate');

The detection of the locale is made automatically, in case none is found, en_US is the default., (*8)

Controller

TODO..., (*9)

Database

DZend_Db_Table

The class DZend_Db_Table implements the __call magic function to add a few functionalities to select queries. For instance, let DbTable_User extends DZend_Db_Table and represents the user database table. To find all female users, just use the call $userDb->findByGender('f'), where $userDb is an instance of DbTable_User. DZend parses the function name recognize the columns., (*10)

The "And" can be used to separate column names. The method of format findByColumnAAndColumnBAndColumnC($a, $b, $c) will return a Zend_Db_Table_Rowset containing all rows that have column_a = $a AND column_b = $b AND column_c = $c., (*11)

To fetch just a Zend_Db_Table_Row instead of a rowset, use findRowBy, instead of findBy., (*12)

Similar to findBy, there is also deleteBy, which deletes all matching rows., (*13)

Registry Cache

If the class extending DZend_Db_Table set $_allowRequestCache to true, then rows will be cached by ID, when using the methods findById or findRowById. Beware that the cache lasts only during the request. Also, be mindful that changed objects are not updated on cache. If an object is fetched and then updated. Feching the object a second time will bring the old object., (*14)

insertMulti Method

While Zend_Db_Table provides a method insert that inserts a single row, DZend_Db_Table provides the insertMulti method that gets an array of data arrays, to insert multiple rows., (*15)

DZend_Db_Table_Row

Usually SQL names for databases, tables and columns uses underscore notation while programming uses camel notation. DZend_Db_Table_Row automatically converts between one another. Let $row be an instance of DZend_Db_Table_Row. $row->columnName can be used to access the column value for column_name., (*16)

CurrentUser

The pre-requisite to get this trait working properly is to have the auth to store the currently logged in user row on DZend_Session_Namespace::get('session')->user. It assumes that the id attribute holds the primary key for the user., (*17)

DZend_CurrentUser is a trait that provider two methods, _getUserRow() and _getUserId(). In case there is not user logged, in it returns null., (*18)

By default, DZend_Model and DZend_Db_Table already extends this trait., (*19)

PHPUnit

TODO..., (*20)

The Versions

23/12 2016

dev-master

9999999-dev

A set of classes to wrap around Zend v1. It' goal is to make common patterns easier to implement and to transparently add commonly used functionalities.

  Sources   Download

The Requires

 

The Development Requires

06/05 2016

1.0.9

1.0.9.0

A set of classes to wrap around Zend v1. It' goal is to make common patterns easier to implement and to transparently add commonly used functionalities.

  Sources   Download

The Requires

 

The Development Requires

19/05 2015

1.0.7

1.0.7.0

A set of classes to wrap around Zend v1. It' goal is to make common patterns easier to implement and to transparently add commonly used functionalities.

  Sources   Download

The Requires

 

The Development Requires

27/02 2015

1.0.6

1.0.6.0

A set of classes to wrap around Zend v1. It' goal is to make common patterns easier to implement and to transparently add commonly used functionalities.

  Sources   Download

The Requires

 

The Development Requires

25/02 2015

1.0.5

1.0.5.0

A set of classes to wrap around Zend v1. It' goal is to make common patterns easier to implement and to transparently add commonly used functionalities.

  Sources   Download

The Requires

 

The Development Requires

12/11 2014

1.0.4

1.0.4.0

A set of classes to wrap around Zend v1. It' goal is to make common patterns easier to implement and to transparently add commonly used functionalities.

  Sources   Download

The Requires

 

The Development Requires

05/09 2014

1.0.3

1.0.3.0

A set of classes to wrap around Zend v1. It' goal is to make common patterns easier to implement and to transparently add commonly used functionalities.

  Sources   Download

The Requires

 

The Development Requires

18/06 2014

1.0.2

1.0.2.0

A set of classes to wrap around Zend v1. It' goal is to make common patterns easier to implement and to transparently add commonly used functionalities.

  Sources   Download

The Requires

 

15/05 2014

1.0.1

1.0.1.0

A set of classes to wrap around Zend v1. It' goal is to make common patterns easier to implement and to transparently add commonly used functionalities.

  Sources   Download

The Requires

 

04/05 2014

1.0.0

1.0.0.0

A set of classes to wrap around Zend v1. It' goal is to make common patterns easier to implement and to transparently add commonly used functionalities.

  Sources   Download

The Requires