eZ\Publish\Core\FieldType\BinaryBase\Type::toHash PHP Метод

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

Converts a $Value to a hash.
public toHash ( eZ\Publish\SPI\FieldType\Value $value ) : mixed
$value eZ\Publish\SPI\FieldType\Value
Результат mixed
    public function toHash(SPIValue $value)
    {
        return array('id' => $value->id, 'path' => $value->inputUri, 'inputUri' => $value->inputUri, 'fileName' => $value->fileName, 'fileSize' => $value->fileSize, 'mimeType' => $value->mimeType, 'uri' => $value->uri);
    }

Usage Example

Пример #1
0
 /**
  * Converts a $Value to a hash.
  *
  * @param \eZ\Publish\Core\FieldType\BinaryFile\Value $value
  *
  * @return mixed
  */
 public function toHash(SPIValue $value)
 {
     if ($this->isEmptyValue($value)) {
         return null;
     }
     $hash = parent::toHash($value);
     $hash['downloadCount'] = $value->downloadCount;
     return $hash;
 }
All Usage Examples Of eZ\Publish\Core\FieldType\BinaryBase\Type::toHash