Skip to content

Commit ec03ddb

Browse files
committed
Adapt and improve the documentation for new features
1 parent 801398b commit ec03ddb

12 files changed

+192
-131
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ Documentation
1616

1717
Documentation for this bundle is stored under `Resources/doc` in this repository.
1818

19-
[Read the documentation for master][]
19+
[Read the documentation for the last stable (1.3)][]
2020

2121
License
2222
-------
2323

2424
This bundle is under the MIT license. See the complete license in the bundle:
2525

2626
```
27-
Resources/meta/LICENSE
27+
Resources/meta/LICENSE
2828
```
2929

30-
[Read the documentation for master]: https://github.com/FriendsOfSymfony/FOSMessageBundle/blob/master/Resources/doc/00-index.md
30+
[Read the documentation for the last stable (1.3)]: https://github.com/FriendsOfSymfony/FOSMessageBundle/blob/master/Resources/doc/00-index.md

Resources/doc/01-installation.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The first step is to tell composer that you want to download FOSMessageBundle wh
1111
be achieved by typing the following at the command prompt:
1212

1313
```bash
14-
$ php composer.phar require friendsofsymfony/message-bundle
14+
$ composer require friendsofsymfony/message-bundle
1515
```
1616

1717
### Step 2 - Setting up your user class
@@ -24,6 +24,7 @@ Your user class may look something like the following:
2424

2525
```php
2626
<?php
27+
// src/AppBundle/Entity/User.php
2728

2829
use Doctrine\ORM\Mapping as ORM;
2930
use FOS\MessageBundle\Model\ParticipantInterface;
@@ -52,7 +53,7 @@ We provide examples for both Mongo DB and ORM.
5253
The bundle must be added to your `AppKernel`
5354

5455
```php
55-
# app/AppKernel.php
56+
// app/AppKernel.php
5657

5758
public function registerBundles()
5859
{
@@ -71,11 +72,9 @@ Add FOSMessageBundle's routing to your application with an optional routing pref
7172
```yaml
7273
# app/config/routing.yml
7374

74-
# ...
7575
fos_message:
7676
resource: "@FOSMessageBundle/Resources/config/routing.xml"
7777
prefix: /optional_routing_prefix
78-
# ...
7978
```
8079
8180
## Installation Finished

Resources/doc/01a-orm-models.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Add the following to your `app/config/config.yml` file.
1414

1515
fos_message:
1616
db_driver: orm
17-
thread_class: Acme\MessageBundle\Entity\Thread
18-
message_class: Acme\MessageBundle\Entity\Message
17+
thread_class: AppBundle\Entity\Thread
18+
message_class: AppBundle\Entity\Message
1919
```
2020
2121
[Continue with the installation][]
@@ -25,12 +25,12 @@ Message class
2525
2626
```php
2727
<?php
28-
// src/Acme/MessageBundle/Entity/Message.php
28+
// src/AppBundle/Entity/Message.php
2929

30-
namespace Acme\MessageBundle\Entity;
30+
namespace AppBundle\Entity;
3131

3232
use Doctrine\ORM\Mapping as ORM;
33-
use Doctrine\Common\Collections\ArrayCollection;
33+
use Doctrine\Common\Collections\Collection;
3434
use FOS\MessageBundle\Entity\Message as BaseMessage;
3535

3636
/**
@@ -47,26 +47,26 @@ class Message extends BaseMessage
4747

4848
/**
4949
* @ORM\ManyToOne(
50-
* targetEntity="Acme\MessageBundle\Entity\Thread",
50+
* targetEntity="AppBundle\Entity\Thread",
5151
* inversedBy="messages"
5252
* )
5353
* @var \FOS\MessageBundle\Model\ThreadInterface
5454
*/
5555
protected $thread;
5656

5757
/**
58-
* @ORM\ManyToOne(targetEntity="Acme\UserBundle\Entity\User")
58+
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\User")
5959
* @var \FOS\MessageBundle\Model\ParticipantInterface
6060
*/
6161
protected $sender;
6262

6363
/**
6464
* @ORM\OneToMany(
65-
* targetEntity="Acme\MessageBundle\Entity\MessageMetadata",
65+
* targetEntity="AppBundle\Entity\MessageMetadata",
6666
* mappedBy="message",
6767
* cascade={"all"}
6868
* )
69-
* @var MessageMetadata[]|\Doctrine\Common\Collections\Collection
69+
* @var MessageMetadata[]|Collection
7070
*/
7171
protected $metadata;
7272
}
@@ -77,9 +77,9 @@ MessageMetadata class
7777

7878
```php
7979
<?php
80-
// src/Acme/MessageBundle/Entity/MessageMetadata.php
80+
// src/AppBundle/Entity/MessageMetadata.php
8181

82-
namespace Acme\MessageBundle\Entity;
82+
namespace AppBundle\Entity;
8383

8484
use Doctrine\ORM\Mapping as ORM;
8585
use FOS\MessageBundle\Entity\MessageMetadata as BaseMessageMetadata;
@@ -98,15 +98,15 @@ class MessageMetadata extends BaseMessageMetadata
9898

9999
/**
100100
* @ORM\ManyToOne(
101-
* targetEntity="Acme\MessageBundle\Entity\Message",
101+
* targetEntity="AppBundle\Entity\Message",
102102
* inversedBy="metadata"
103103
* )
104104
* @var \FOS\MessageBundle\Model\MessageInterface
105105
*/
106106
protected $message;
107107

108108
/**
109-
* @ORM\ManyToOne(targetEntity="Acme\UserBundle\Entity\User")
109+
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\User")
110110
* @var \FOS\MessageBundle\Model\ParticipantInterface
111111
*/
112112
protected $participant;
@@ -118,12 +118,12 @@ Thread class
118118

119119
```php
120120
<?php
121-
// src/Acme/MessageBundle/Entity/Thread.php
121+
// src/AppBundle/Entity/Thread.php
122122

123-
namespace Acme\MessageBundle\Entity;
123+
namespace AppBundle\Entity;
124124

125125
use Doctrine\ORM\Mapping as ORM;
126-
use Doctrine\Common\Collections\ArrayCollection;
126+
use Doctrine\Common\Collections\Collection;
127127
use FOS\MessageBundle\Entity\Thread as BaseThread;
128128

129129
/**
@@ -139,27 +139,27 @@ class Thread extends BaseThread
139139
protected $id;
140140

141141
/**
142-
* @ORM\ManyToOne(targetEntity="Acme\UserBundle\Entity\User")
142+
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\User")
143143
* @var \FOS\MessageBundle\Model\ParticipantInterface
144144
*/
145145
protected $createdBy;
146146

147147
/**
148148
* @ORM\OneToMany(
149-
* targetEntity="Acme\MessageBundle\Entity\Message",
149+
* targetEntity="AppBundle\Entity\Message",
150150
* mappedBy="thread"
151151
* )
152-
* @var Message[]|\Doctrine\Common\Collections\Collection
152+
* @var Message[]|Collection
153153
*/
154154
protected $messages;
155155

156156
/**
157157
* @ORM\OneToMany(
158-
* targetEntity="Acme\MessageBundle\Entity\ThreadMetadata",
158+
* targetEntity="AppBundle\Entity\ThreadMetadata",
159159
* mappedBy="thread",
160160
* cascade={"all"}
161161
* )
162-
* @var ThreadMetadata[]|\Doctrine\Common\Collections\Collection
162+
* @var ThreadMetadata[]|Collection
163163
*/
164164
protected $metadata;
165165
}
@@ -170,9 +170,9 @@ ThreadMetadata class
170170

171171
```php
172172
<?php
173-
// src/Acme/MessageBundle/Entity/ThreadMetadata.php
173+
// src/AppBundle/Entity/ThreadMetadata.php
174174

175-
namespace Acme\MessageBundle\Entity;
175+
namespace AppBundle\Entity;
176176

177177
use Doctrine\ORM\Mapping as ORM;
178178
use FOS\MessageBundle\Entity\ThreadMetadata as BaseThreadMetadata;
@@ -191,15 +191,15 @@ class ThreadMetadata extends BaseThreadMetadata
191191

192192
/**
193193
* @ORM\ManyToOne(
194-
* targetEntity="Acme\MessageBundle\Entity\Thread",
194+
* targetEntity="AppBundle\Entity\Thread",
195195
* inversedBy="metadata"
196196
* )
197197
* @var \FOS\MessageBundle\Model\ThreadInterface
198198
*/
199199
protected $thread;
200200

201201
/**
202-
* @ORM\ManyToOne(targetEntity="Acme\UserBundle\Entity\User")
202+
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\User")
203203
* @var \FOS\MessageBundle\Model\ParticipantInterface
204204
*/
205205
protected $participant;

Resources/doc/01b-odm-models.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Add the following to your `app/config/config.yml` file.
1414

1515
fos_message:
1616
db_driver: mongodb
17-
thread_class: Acme\MessageBundle\Document\Thread
18-
message_class: Acme\MessageBundle\Document\Message
17+
thread_class: AppBundle\Document\Thread
18+
message_class: AppBundle\Document\Message
1919
```
2020
2121
You may have to include the MessageBundle in your Doctrine mapping configuration,
@@ -39,9 +39,9 @@ Message class
3939
4040
```php
4141
<?php
42-
// src/Acme/MessageBundle/Document/Message.php
42+
// src/AppBundle/Document/Message.php
4343

44-
namespace Acme\MessageBundle\Document;
44+
namespace AppBundle\Document;
4545

4646
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
4747
use FOS\MessageBundle\Document\Message as BaseMessage;
@@ -57,17 +57,17 @@ class Message extends BaseMessage
5757
protected $id;
5858

5959
/**
60-
* @MongoDB\EmbedMany(targetDocument="Acme\MessageBundle\Document\MessageMetadata")
60+
* @MongoDB\EmbedMany(targetDocument="AppBundle\Document\MessageMetadata")
6161
*/
6262
protected $metadata;
6363

6464
/**
65-
* @MongoDB\ReferenceOne(targetDocument="Acme\MessageBundle\Document\Thread")
65+
* @MongoDB\ReferenceOne(targetDocument="AppBundle\Document\Thread")
6666
*/
6767
protected $thread;
6868

6969
/**
70-
* @MongoDB\ReferenceOne(targetDocument="Acme\UserBundle\Document\User")
70+
* @MongoDB\ReferenceOne(targetDocument="AppBundle\Document\User")
7171
*/
7272
protected $sender;
7373
}
@@ -78,8 +78,9 @@ MessageMetadata class
7878

7979
```php
8080
<?php
81+
// src/AppBundle/Document/MessageMetadata.php
8182

82-
namespace Mashup\MessageBundle\Document;
83+
namespace AppBundle\Document;
8384

8485
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
8586
use FOS\MessageBundle\Document\MessageMetadata as BaseMessageMetadata;
@@ -90,7 +91,7 @@ use FOS\MessageBundle\Document\MessageMetadata as BaseMessageMetadata;
9091
class MessageMetadata extends BaseMessageMetadata
9192
{
9293
/**
93-
* @ODM\ReferenceOne(targetDocument="Mashup\UserBundle\Document\User")
94+
* @ODM\ReferenceOne(targetDocument="AppBundle\Document\User")
9495
*/
9596
protected $participant;
9697
}
@@ -101,9 +102,9 @@ Thread class
101102

102103
```php
103104
<?php
104-
// src/Acme/MessageBundle/Document/Thread.php
105+
// src/AppBundle/Document/Thread.php
105106

106-
namespace Acme\MessageBundle\Document;
107+
namespace AppBundle\Document;
107108

108109
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
109110
use FOS\MessageBundle\Document\Thread as BaseThread;
@@ -119,22 +120,22 @@ class Thread extends BaseThread
119120
protected $id;
120121

121122
/**
122-
* @MongoDB\ReferenceMany(targetDocument="Acme\MessageBundle\Document\Message")
123+
* @MongoDB\ReferenceMany(targetDocument="AppBundle\Document\Message")
123124
*/
124125
protected $messages;
125126

126127
/**
127-
* @MongoDB\EmbedMany(targetDocument="Acme\MessageBundle\Document\ThreadMetadata")
128+
* @MongoDB\EmbedMany(targetDocument="AppBundle\Document\ThreadMetadata")
128129
*/
129130
protected $metadata;
130131

131132
/**
132-
* @MongoDB\ReferenceMany(targetDocument="Acme\UserBundle\Document\User")
133+
* @MongoDB\ReferenceMany(targetDocument="AppBundle\Document\User")
133134
*/
134135
protected $participants;
135136

136137
/**
137-
* @MongoDB\ReferenceOne(targetDocument="Acme\UserBundle\Document\User")
138+
* @MongoDB\ReferenceOne(targetDocument="AppBundle\Document\User")
138139
*/
139140
protected $createdBy;
140141
}
@@ -145,8 +146,9 @@ ThreadMetadata class
145146

146147
```php
147148
<?php
149+
// src/AppBundle/Document/ThreadMetadata.php
148150

149-
namespace Mashup\MessageBundle\Document;
151+
namespace AppBundle\Document;
150152

151153
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
152154
use FOS\MessageBundle\Document\ThreadMetadata as BaseThreadMetadata;
@@ -157,7 +159,7 @@ use FOS\MessageBundle\Document\ThreadMetadata as BaseThreadMetadata;
157159
class ThreadMetadata extends BaseThreadMetadata
158160
{
159161
/**
160-
* @ODM\ReferenceOne(targetDocument="Mashup\UserBundle\Document\User")
162+
* @ODM\ReferenceOne(targetDocument="AppBundle\Document\User")
161163
*/
162164
protected $participant;
163165
}

0 commit comments

Comments
 (0)