Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1431244
DoctrineEmptyCollectionFilter.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
705 B
Referenced Files
None
Subscribers
None
DoctrineEmptyCollectionFilter.php
View Options
<?php
namespace
DeepCopy\Filter\Doctrine
;
use
DeepCopy\Filter\Filter
;
use
DeepCopy\Reflection\ReflectionHelper
;
use
Doctrine\Common\Collections\ArrayCollection
;
/**
* @final
*/
class
DoctrineEmptyCollectionFilter
implements
Filter
{
/**
* Sets the object property to an empty doctrine collection.
*
* @param object $object
* @param string $property
* @param callable $objectCopier
*/
public
function
apply
(
$object
,
$property
,
$objectCopier
)
{
$reflectionProperty
=
ReflectionHelper
::
getProperty
(
$object
,
$property
);
$reflectionProperty
->
setAccessible
(
true
);
$reflectionProperty
->
setValue
(
$object
,
new
ArrayCollection
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 20:13 (1 d, 25 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
41/8c/0b74cccca71626fc6d3d02b880b7
Default Alt Text
DoctrineEmptyCollectionFilter.php (705 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment