PHP Objects, Patterns and Practice (3rd edition)
CHAPTER 13 ■ DATABASE PATTERNS Collection object. While there’s nothing wrong with allowing callbacks (as you have seen in the V ...
CHAPTER 13 ■ DATABASE PATTERNS methods here, or you could build an observer relationship between the ObjectWatcher and your crea ...
CHAPTER 13 ■ DATABASE PATTERNS Figure 13–8 shows the PersistenceFactory class. I’ll be using this to organize the various compon ...
CHAPTER 13 ■ DATABASE PATTERNS are required to craft many similar but differing queries both within a single Mapper class and ac ...
CHAPTER 13 ■ DATABASE PATTERNS } class EventIdentityObject extends IdentityObject { private $start = null; private $minstart = n ...
CHAPTER 13 ■ DATABASE PATTERNS to. The child classes provide convenience methods for adding this data to the underlying structur ...
CHAPTER 13 ■ DATABASE PATTERNS if (! is_null( $field ) ) { $this->field( $field ); } } // field names to which this is constr ...
CHAPTER 13 ■ DATABASE PATTERNS // greater than function gt( $value ) { return $this->operator( ">", $value ); } // does th ...
CHAPTER 13 ■ DATABASE PATTERNS The EventIdentityObject class now enforces a set of fields. Here’s what happens if I try to work ...
CHAPTER 13 ■ DATABASE PATTERNS Figure 13–10. Selection and update factories Selection and update factories are, once again, typi ...
CHAPTER 13 ■ DATABASE PATTERNS $query .= implode ( " = ?,", array_keys( $fields ) )." = ?"; $terms = array_values( $fields ); $c ...
CHAPTER 13 ■ DATABASE PATTERNS Notice that the newUpdate() method will accept any DomainObject. This is so that all UpdateFactor ...
CHAPTER 13 ■ DATABASE PATTERNS Consequences The use of a generic identity object implementation makes it easier to use a single ...
CHAPTER 13 ■ DATABASE PATTERNS } return $this->statements[$str]; } function findOne( IdentityObject $idobj ) { $collection = ...
CHAPTER 13 ■ DATABASE PATTERNS Figure 13–11. Some of the persistence classes developed in this chapter A client coder might then ...
CHAPTER 13 ■ DATABASE PATTERNS Data Mapper: Create specialist classes for mapping Domain Model objects to and from relational d ...
P A R T 4 ■ ■ ■ Practice ...
CHAPTER 1 ■ PHP: DESIGN AND MANAGEMENT ...
C H A P T E R 14 ■ ■ ■ Good (and Bad) Practice So far in this book, I have focused on coding, concentrating particularly on the ...
■Chapter 14: Good (and Bad) Practice ................................................................ building a component that ...
«
12
13
14
15
16
17
18
19
20
21
»
Free download pdf