Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4139775
ObjectType.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ObjectType.php
View Options
<?php
namespace
Doctrine\DBAL\Types
;
use
Doctrine\DBAL\Platforms\AbstractPlatform
;
use
Doctrine\Deprecations\Deprecation
;
use
function
is_resource
;
use
function
restore_error_handler
;
use
function
serialize
;
use
function
set_error_handler
;
use
function
stream_get_contents
;
use
function
unserialize
;
/**
* Type that maps a PHP object to a clob SQL type.
*
* @deprecated Use {@link JsonType} instead.
*/
class
ObjectType
extends
Type
{
/**
* {@inheritDoc}
*/
public
function
getSQLDeclaration
(
array
$column
,
AbstractPlatform
$platform
)
{
return
$platform
->
getClobTypeDeclarationSQL
(
$column
);
}
/**
* {@inheritDoc}
*
* @param mixed $value
*
* @return string
*/
public
function
convertToDatabaseValue
(
$value
,
AbstractPlatform
$platform
)
{
return
serialize
(
$value
);
}
/**
* {@inheritDoc}
*/
public
function
convertToPHPValue
(
$value
,
AbstractPlatform
$platform
)
{
if
(
$value
===
null
)
{
return
null
;
}
$value
=
is_resource
(
$value
)
?
stream_get_contents
(
$value
)
:
$value
;
set_error_handler
(
function
(
int
$code
,
string
$message
):
bool
{
throw
ConversionException
::
conversionFailedUnserialization
(
$this
->
getName
(),
$message
);
});
try
{
return
unserialize
(
$value
);
}
finally
{
restore_error_handler
();
}
}
/**
* {@inheritDoc}
*/
public
function
getName
()
{
return
Types
::
OBJECT
;
}
/**
* {@inheritDoc}
*
* @deprecated
*/
public
function
requiresSQLCommentHint
(
AbstractPlatform
$platform
)
{
Deprecation
::
triggerIfCalledFromOutside
(
'doctrine/dbal'
,
'https://github.com/doctrine/dbal/pull/5509'
,
'%s is deprecated.'
,
__METHOD__
,
);
return
true
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 19, 15:12 (3 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
07/c0/0435476b6d34ef680acbc45dbeca
Default Alt Text
ObjectType.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment