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
파일: ArrayTest.php 프로젝트: doctrine/oxm
 /**
  * @group DBAL-73
  */
 public function testFalseConversion()
 {
     $this->assertFalse($this->_type->convertToPHPValue(serialize(false)));
 }