Doctrine\OXM\Types\ArrayType::convertToPHPValue PHP Метод

convertToPHPValue() публичный Метод

todo - use something more friendly here? like implode/explode?
public convertToPHPValue ( $value )
    public function convertToPHPValue($value)
    {
        if ($value === null) {
            return null;
        }
        $value = is_resource($value) ? stream_get_contents($value) : $value;
        $val = unserialize($value);
        if ($val === false && $value != 'b:0;') {
            throw ConversionException::conversionFailed($value, $this->getName());
        }
        return $val;
    }

Usage Example

Пример #1
0
 /**
  * @group DBAL-73
  */
 public function testFalseConversion()
 {
     $this->assertFalse($this->_type->convertToPHPValue(serialize(false)));
 }