concept datum in category php

appears as: data, data, The data
Zend Framework in Action

This is an excerpt from Manning's book Zend Framework in Action.

Zend_Validate provides a very similar function to Zend_Filter, except that it provides a yes/no answer to the question, “Is this data what I expect?” Validation is generally used to ensure that the data is correctly formed, such as ensuring that the data entered in an email address field is actually an email address. In the case of failure, Zend_Validate also provides a message indicating why the input failed validation so that appropriate error messages can be returned to the end user.

We have now looked at all the major database operations that can be done using the Zend_Db_Adapter and Zend_Db_Table components. Database operations in a Model-View-Controller application usually are part of the model. This is because the model is where the business logic of the application is, and the data stored in a database is very much related to the business of the application.

The $result variable contains a standard PHP PDOStatement object, so you can use the standard calls, such as fetch() or fetchAll(), to retrieve the data. In this case, we used a standard SQL string to specify the query.

Figure 9.1. A Zend_Search_Lucene index consists of multiple documents, each containing multiple fields. The data in some fields is not stored, and some fields may contain data for display rather than searching.
PHP in Action: Objects, Design, Agility

This is an excerpt from Manning's book PHP in Action: Objects, Design, Agility.

This is good, except for the obvious fact that we usually don’t need two classes that work exactly the same way. It makes more sense if the child class contains some implementation. We can add new methods and data or we can override methods. For example, the NewsArticle class may have variables, say $newsSource or $byline, that are not present in the Document class.

Fowler’s Table Data Gateway pattern is a class that—in its simplest form—handles access to a single database table. The principle is to have a class that finds and saves plain data in the database. The data that’s retrieved and saved is typically not in the form of objects, or if it is, the objects tend to be rather simple data containers.

The Finder we just built is half a Table Data Gateway. In other words, the methods in a Table Data Gateway that retrieve data from a database are like the Finder methods in the previous examples. The methods that are missing are methods to insert, update, and delete data.

Listing 21.5. Return data from a Table Data Gateway as arrays
Array ( [0] => Array ( [user_id] => 1 [username] => victor [firstname] => Victor [lastname] => Ploctor [password] => 5d009bfda017b80dd1ce08c7e68458be [email] => victor@example.com [usertype] => regular ) [1] => Array ( [user_id] => 2 [username] => elietta [firstname] => Elietta [lastname] => Floon [password] => 7db7c42a13bd7e3202fbbc94435fb85a [email] => elietta@example.com [usertype] => regular )