eZ\Publish\Core\FieldType\Page\HashConverter::convertItemFromHash PHP Method

convertItemFromHash() protected method

Converts the given $hash to a Item node.
protected convertItemFromHash ( mixed $hash ) : Item
$hash mixed
return eZ\Publish\Core\FieldType\Page\Parts\Item
    protected function convertItemFromHash($hash)
    {
        foreach ($hash as $key => &$item) {
            switch ($key) {
                case 'publicationDate':
                case 'visibilityDate':
                case 'hiddenDate':
                case 'rotationUntilDate':
                    // $item is expected to be a date string in RFC850 format
                    $item = new \DateTime($item);
                    break;
            }
        }
        return new Item($hash);
    }