Skip to content

Commit

Permalink
Renamed "CollectionFilter" to "DoctrineCollectionFilter"
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Oct 1, 2013
1 parent a937b0e commit 2c8df9f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Install with Composer:

```json
{
"require": {
"myclabs/deep-copy": "*"
}
"require": {
"myclabs/deep-copy": "*"
}
}
```

Expand Down Expand Up @@ -131,13 +131,13 @@ $myCopy = $deepCopy->copy($myObject);
// $myCopy->category has not been touched
```

#### Doctrine `CollectionFilter`
#### `DoctrineCollectionFilter`

If you use Doctrine and want to copy an entity, you will need to use the `CollectionFilter`:
If you use Doctrine and want to copy an entity, you will need to use the `DoctrineCollectionFilter`:

```php
$deepCopy = new DeepCopy();
$deepCopy->addFilter(new CollectionFilter(), new PropertyTypeMatcher('Doctrine\Common\Collections\Collection'));
$deepCopy->addFilter(new DoctrineCollectionFilter(), new PropertyTypeMatcher('Doctrine\Common\Collections\Collection'));
$myCopy = $deepCopy->copy($myObject);
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* Set a null value for a property
*/
class CollectionFilter implements Filter
class DoctrineCollectionFilter implements Filter
{
/**
* {@inheritdoc}
Expand Down
6 changes: 3 additions & 3 deletions tests/DeepCopyTest/Filter/Doctrine/CollectionFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace DeepCopyTest\Filter\Doctrine;

use DeepCopy\DeepCopy;
use DeepCopy\Filter\Doctrine\CollectionFilter;
use DeepCopy\Filter\Doctrine\DoctrineCollectionFilter;
use DeepCopy\Matcher\PropertyMatcher;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
Expand All @@ -20,7 +20,7 @@ public function testApply()
$oldCollection->add(new \stdClass());
$object->foo = $oldCollection;

$filter = new CollectionFilter();
$filter = new DoctrineCollectionFilter();
$filter->apply($object, 'foo', function($item) {
return null;
});
Expand All @@ -39,7 +39,7 @@ public function testIntegration()
$o->property1 = $oldCollection;

$deepCopy = new DeepCopy();
$deepCopy->addFilter(new CollectionFilter(), new PropertyMatcher(get_class($o), 'property1'));
$deepCopy->addFilter(new DoctrineCollectionFilter(), new PropertyMatcher(get_class($o), 'property1'));
/** @var CollectionFilterTestFixture $new */
$new = $deepCopy->copy($o);

Expand Down

0 comments on commit 2c8df9f

Please sign in to comment.