This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Morph.pkg
97 lines (91 loc) · 2.63 KB
/
Morph.pkg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<refentry id="{@id}">
<refnamediv>
<refname>
The Morph Package
</refname>
<refpurpose>
An introductory tutorial to Morph
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<author>
<authorblurb>
{@link mailto:jonathan.moss@tangentlabs.co.uk Jonathan
Moss}
</authorblurb>
</author>
<para>
The Morph package provides a high level framework for working
with
MongoDB. It
provides an infrastructure to translate seemlessly
between hierarchies of PHP
objects and {@link http://www.mongodb.org
MongoDB}.
</para>
</refsynopsisdiv>
{@toc}
<refsect1 id="{@id intro}">
<title>Overview</title>
<para>
This package comprises a suite of objects and object primitives
that are
designed
to make working with {@link http://www.mongodb.org
MongoDB} in PHP a
breeze.
</para>
<para>
With Morph, working with {@link http://www.mongodb.org MongoDB}
is no more
difficult
that working with object oriented PHP.
</para>
</refsect1>
<refsect1 id="{@id basic_usage}">
<title>Basic Usage</title>
<para>
In the following section we go over the basics of Morph. How we create objects
suitable for storage in {@link http://www.mongodb.org MongoDB} and how we
can store and retrieve those object.
</para>
<refsect2 id="{@id basic_usage_morph_object}">
<title>Morph_Object</title>
<para>
Morph_Object provides a flexible base for defining object hierarchies which can
be
stored in {@link http://www.mongodb.org MongoDB}.
</para>
<para>
{@example MinimalObject.php}
The example above show all you really need to know to start building
php objects that can be stored in {@link http://www.mongodb.org
MongoDB}.
As you can see the only real requirements are that you extend
Morph_Object
and the the properties you wish to store as part of the object are
added
using the Morph_Object::addProperty().
</para>
</refsect2>
<refsect2 id="{@id basic_usage_storage}">
<title>Storage & Retrieval</title>
<para>
The next step in our journey is how to store and retrieve
object from the database. For this we need to use the
Morph_Storage object which represents our interface to the
database
</para>
<para>
The following example illustrates how you can store an object
in the database
{@example BasicUsageStorage.php}
</para>
<para>
This example shows that how we can get an object back from the database
by it's id
{@example BasicUsageRetrieval.php}
</para>
</refsect2>
</refsect1>
</refentry>