php - Argument passed must be an instance of longtext, string given - doctrin2 symfony -


i have problem polluting mysql field defined text field data received result of serialize() php command. using symfony2 doctrine annotations.

my service code:

$oe = serialize($object); $log->setobject(serialize($object)); 

and entity:

/**      * @orm\column(type="text")      */     protected $object; 

the error following:

symfony search on symfony website exception detected! catchable fatal error: argument 1 passed appbundle\entity\log::setobject() must instance of longtext, string given, called in c:\wamp\www\symfony_learn\src\appbundle\service\loggerservice.php on line 22 , defined 500 internal server error - contexterrorexception  

it seems there mismatch of data types don't quite understand 1 data type string , second text , mind conversion should take place automatically. know can mysql cast wonder symfony2 , doctrine2 provides tools deal such situation?

try using mysql cast:

cast(yourvarchar longtext)  

Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -