Skip to content
This repository was archived by the owner on Jan 24, 2020. It is now read-only.

Commit bd2cdf5

Browse files
committed
Renamed repository to doctrine-zend-hydrator and changed namespace accordingly
1 parent 58e4461 commit bd2cdf5

30 files changed

+80
-80
lines changed

README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# zend-doctrine-hydrator
1+
# doctrine-zend-hydrator
22

3-
[![Build Status](https://travis-ci.org/webimpress/zend-doctrine-hydrator.svg?branch=master)](https://travis-ci.org/webimpress/zend-doctrine-hydrator)
4-
[![Coverage Status](https://coveralls.io/repos/github/webimpress/zend-doctrine-hydrator/badge.svg?branch=master)](https://coveralls.io/github/webimpress/zend-doctrine-hydrator?branch=master)
3+
[![Build Status](https://travis-ci.org/webimpress/doctrine-zend-hydrator.svg?branch=master)](https://travis-ci.org/webimpress/doctrine-zend-hydrator)
4+
[![Coverage Status](https://coveralls.io/repos/github/webimpress/doctrine-zend-hydrator/badge.svg?branch=master)](https://coveralls.io/github/webimpress/doctrine-zend-hydrator?branch=master)
55

66
This library provides Doctrine Hydrators for Zend Framework application.
77

@@ -10,7 +10,7 @@ This library provides Doctrine Hydrators for Zend Framework application.
1010
Run the following to install this library:
1111

1212
```bash
13-
$ composer require webimpress/zend-doctrine-hydrator
13+
$ composer require webimpress/doctrine-zend-hydrator
1414
```
1515

1616
## Usage
@@ -32,7 +32,7 @@ To create a Doctrine Hydrator, you just need one thing: an object manager (also
3232
or Document Manager in Doctrine ODM):
3333

3434
```php
35-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
35+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
3636

3737
$hydrator = new DoctrineHydrator($objectManager);
3838
```
@@ -88,7 +88,7 @@ class City
8888
Now, let's use the Doctrine hydrator:
8989

9090
```php
91-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
91+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
9292

9393
$hydrator = new DoctrineHydrator($entityManager);
9494
$city = new City();
@@ -152,7 +152,7 @@ class Appointment
152152
Let's use the hydrator:
153153

154154
```php
155-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
155+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
156156

157157
$hydrator = new DoctrineHydrator($entityManager);
158158
$appointment = new Appointment();
@@ -295,7 +295,7 @@ DoctrineHydrator natively supports both cases.
295295
When the association's entity already exists, all you need to do is simply give the identifier of the association:
296296

297297
```php
298-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
298+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
299299

300300
$hydrator = new DoctrineHydrator($entityManager);
301301
$blogPost = new BlogPost();
@@ -338,7 +338,7 @@ $data = [
338338
If the association's entity does not exist, you just need to give the object:
339339

340340
```php
341-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
341+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
342342

343343
$hydrator = new DoctrineHydrator($entityManager);
344344
$blogPost = new BlogPost();
@@ -389,7 +389,7 @@ be hydrated before it is passed to the BlogPost entity.
389389
**NOTE** : you're not really allowing users to be added via a blog post, are you?
390390

391391
```php
392-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
392+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
393393

394394
$hydrator = new DoctrineHydrator($entityManager, 'Application\Entity\BlogPost');
395395
$blogPost = new BlogPost();
@@ -565,7 +565,7 @@ Once again, two cases may arise: the tags already exist or they do not.
565565
When the association's entity already exists, what you need to do is simply give the identifiers of the entities:
566566

567567
```php
568-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
568+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
569569

570570
$hydrator = new DoctrineHydrator($entityManager);
571571
$blogPost = new BlogPost();
@@ -609,7 +609,7 @@ $data = [
609609
If the association's entity does not exist, you just need to give the object:
610610

611611
```php
612-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
612+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
613613

614614
$hydrator = new DoctrineHydrator($entityManager);
615615
$blogPost = new BlogPost();
@@ -678,14 +678,14 @@ The hydrator will check whether the setCity() method on the Entity allows null v
678678

679679
By default, every collections association has a special strategy attached to it that is called during the hydrating
680680
and extracting phase. All those strategies extend from the class
681-
`Zend\Doctrine\Hydrator\Strategy\AbstractCollectionStrategy`.
681+
`Doctrine\Zend\Hydrator\Strategy\AbstractCollectionStrategy`.
682682

683683
The library provides four strategies out of the box:
684684

685-
1. `Zend\Doctrine\Hydrator\Strategy\AllowRemoveByValue`: this is the default strategy, it removes old elements that are not in the new collection.
686-
2. `Zend\Doctrine\Hydrator\Strategy\AllowRemoveByReference`: this is the default strategy (if set to byReference), it removes old elements that are not in the new collection.
687-
3. `Zend\Doctrine\Hydrator\Strategy\DisallowRemoveByValue`: this strategy does not remove old elements even if they are not in the new collection.
688-
4. `Zend\Doctrine\Hydrator\Strategy\DisallowRemoveByReference`: this strategy does not remove old elements even if they are not in the new collection.
685+
1. `Doctrine\Zend\Hydrator\Strategy\AllowRemoveByValue`: this is the default strategy, it removes old elements that are not in the new collection.
686+
2. `Doctrine\Zend\Hydrator\Strategy\AllowRemoveByReference`: this is the default strategy (if set to byReference), it removes old elements that are not in the new collection.
687+
3. `Doctrine\Zend\Hydrator\Strategy\DisallowRemoveByValue`: this strategy does not remove old elements even if they are not in the new collection.
688+
4. `Doctrine\Zend\Hydrator\Strategy\DisallowRemoveByReference`: this strategy does not remove old elements even if they are not in the new collection.
689689

690690
As a consequence, when using `AllowRemove*`, you need to define both adder (eg. addTags) and remover (eg. removeTags).
691691
On the other hand, when using the `DisallowRemove*` strategy, you must always define at least the adder, but the remover
@@ -708,8 +708,8 @@ remove elements directly from the collection.
708708
Changing the strategy for collections is plain easy.
709709

710710
```php
711-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
712-
use Zend\Doctrine\Hydrator\Strategy;
711+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
712+
use Doctrine\Zend\Hydrator\Strategy;
713713

714714
$hydrator = new DoctrineHydrator($entityManager);
715715
$hydrator->addStrategy('tags', new Strategy\DisallowRemoveByValue());
@@ -728,7 +728,7 @@ and hence bypass any logic you may include in your setters/getters).
728728
To change the behaviour, just give the second parameter of the constructor to false:
729729

730730
```php
731-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
731+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
732732

733733
$hydrator = new DoctrineHydrator($objectManager, false);
734734
```
@@ -762,7 +762,7 @@ class SimpleEntity
762762
Let's now use the hydrator using the default method, by value:
763763

764764
```php
765-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
765+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
766766

767767
$hydrator = new DoctrineHydrator($objectManager);
768768
$object = new SimpleEntity();
@@ -778,7 +778,7 @@ As we can see here, the hydrator used the public API (here getFoo) to retrieve t
778778
However, if we use it by reference:
779779

780780
```php
781-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
781+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
782782

783783
$hydrator = new DoctrineHydrator($objectManager, false);
784784
$object = new SimpleEntity();
@@ -964,7 +964,7 @@ namespace Application\Form;
964964

965965
use Application\Entity\Tag;
966966
use Doctrine\Common\Persistence\ObjectManager;
967-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
967+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
968968
use Zend\Form\Fieldset;
969969
use Zend\InputFilter\InputFilterProviderInterface;
970970

@@ -1012,7 +1012,7 @@ namespace Application\Form;
10121012

10131013
use Application\Entity\BlogPost;
10141014
use Doctrine\Common\Persistence\ObjectManager;
1015-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
1015+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
10161016
use Zend\Form\Fieldset;
10171017
use Zend\InputFilter\InputFilterProviderInterface;
10181018

@@ -1068,7 +1068,7 @@ Here is the create form:
10681068
namespace Application\Form;
10691069

10701070
use Doctrine\Common\Persistence\ObjectManager;
1071-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
1071+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
10721072
use Zend\Form\Form;
10731073

10741074
class CreateBlogPostForm extends Form
@@ -1098,7 +1098,7 @@ And the update form:
10981098
namespace Application\Form;
10991099

11001100
use Doctrine\Common\Persistence\ObjectManager;
1101-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
1101+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
11021102
use Zend\Form\Form;
11031103

11041104
class UpdateBlogPostForm extends Form
@@ -1247,7 +1247,7 @@ namespace Application\Form;
12471247

12481248
use Application\Entity\User;
12491249
use Doctrine\Common\Persistence\ObjectManager;
1250-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
1250+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
12511251
use Zend\Form\Fieldset;
12521252
use Zend\InputFilter\InputFilterProviderInterface;
12531253

@@ -1295,7 +1295,7 @@ namespace Application\Form;
12951295

12961296
use Application\Entity\City;
12971297
use Doctrine\Common\Persistence\ObjectManager;
1298-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
1298+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
12991299
use Zend\Form\Fieldset;
13001300
use Zend\InputFilter\InputFilterProviderInterface;
13011301

@@ -1353,7 +1353,7 @@ be like this :
13531353
namespace Application\Form;
13541354

13551355
use Doctrine\Common\Persistence\ObjectManager;
1356-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
1356+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
13571357
use Zend\Form\Form;
13581358

13591359
class EditNameForm extends Form
@@ -1440,7 +1440,7 @@ EditUserForm :
14401440
namespace Application\Form;
14411441

14421442
use Doctrine\Common\Persistence\ObjectManager;
1443-
use Zend\Doctrine\Hydrator\DoctrineObject as DoctrineHydrator;
1443+
use Doctrine\Zend\Hydrator\DoctrineObject as DoctrineHydrator;
14441444
use Zend\Form\Form;
14451445

14461446
class EditNameForm extends Form

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
2-
"name": "webimpress/zend-doctrine-hydrator",
2+
"name": "webimpress/doctrine-zend-hydrator",
33
"description": "Doctrine hydrators for Zend Framework applications",
44
"license": "BSD-2-Clause",
55
"keywords": [
6-
"zf",
7-
"zendframework",
86
"doctrine",
9-
"hydrator"
7+
"hydrator",
8+
"zf",
9+
"zendframework"
1010
],
1111
"support": {
12-
"issues": "https://github.com/webimpress/zend-doctrine-hydrator/issues",
13-
"source": "https://github.com/webimpress/zend-doctrine-hydrator",
14-
"rss": "https://github.com/webimpress/zend-doctrine-hydrator/releases.atom"
12+
"issues": "https://github.com/webimpress/doctrine-zend-hydrator/issues",
13+
"source": "https://github.com/webimpress/doctrine-zend-hydrator",
14+
"rss": "https://github.com/webimpress/doctrine-zend-hydrator/releases.atom"
1515
},
1616
"require": {
1717
"php": "^7.1",
@@ -28,12 +28,12 @@
2828
},
2929
"autoload": {
3030
"psr-4": {
31-
"Zend\\Doctrine\\Hydrator\\": "src/"
31+
"Doctrine\\Zend\\Hydrator\\": "src/"
3232
}
3333
},
3434
"autoload-dev": {
3535
"psr-4": {
36-
"ZendTest\\Doctrine\\Hydrator\\": "test/"
36+
"DoctrineTest\\Zend\\Hydrator\\": "test/"
3737
}
3838
},
3939
"config": {

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
bootstrap="vendor/autoload.php"
55
colors="true">
66
<testsuites>
7-
<testsuite name="zend-doctrine-hydrator">
7+
<testsuite name="doctrine-zend-hydrator">
88
<directory>./test</directory>
99
</testsuite>
1010
</testsuites>

src/DoctrineObject.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
declare(strict_types=1);
44

5-
namespace Zend\Doctrine\Hydrator;
5+
namespace Doctrine\Zend\Hydrator;
66

77
use DateTime;
88
use Doctrine\Common\Inflector\Inflector;
99
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
1010
use Doctrine\Common\Persistence\ObjectManager;
11+
use Doctrine\Zend\Hydrator\Strategy\AllowRemoveByReference;
12+
use Doctrine\Zend\Hydrator\Strategy\AllowRemoveByValue;
1113
use InvalidArgumentException;
1214
use RuntimeException;
1315
use Traversable;
14-
use Zend\Doctrine\Hydrator\Strategy\AllowRemoveByReference;
15-
use Zend\Doctrine\Hydrator\Strategy\AllowRemoveByValue;
1616
use Zend\Hydrator\AbstractHydrator;
1717
use Zend\Hydrator\Filter\FilterProviderInterface;
1818
use Zend\Stdlib\ArrayUtils;

src/Filter/PropertyName.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Zend\Doctrine\Hydrator\Filter;
5+
namespace Doctrine\Zend\Hydrator\Filter;
66

77
use Zend\Hydrator\Filter\FilterInterface;
88

src/Strategy/AbstractCollectionStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Zend\Doctrine\Hydrator\Strategy;
5+
namespace Doctrine\Zend\Hydrator\Strategy;
66

77
use Doctrine\Common\Collections\Collection;
88
use Doctrine\Common\Persistence\Mapping\ClassMetadata;

src/Strategy/AllowRemoveByReference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Zend\Doctrine\Hydrator\Strategy;
5+
namespace Doctrine\Zend\Hydrator\Strategy;
66

77
/**
88
* When this strategy is used for Collections, if the new collection does not contain elements that are present in

src/Strategy/AllowRemoveByValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Zend\Doctrine\Hydrator\Strategy;
5+
namespace Doctrine\Zend\Hydrator\Strategy;
66

77
use Doctrine\Common\Collections\ArrayCollection;
88
use Doctrine\Common\Collections\Collection;

src/Strategy/DisallowRemoveByReference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Zend\Doctrine\Hydrator\Strategy;
5+
namespace Doctrine\Zend\Hydrator\Strategy;
66

77
/**
88
* When this strategy is used for Collections, if the new collection does not contain elements that are present in

0 commit comments

Comments
 (0)