PHP code example of iserv / zeit-bridge

1. Go to this page and download the library: Download iserv/zeit-bridge library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

iserv / zeit-bridge example snippets


use Doctrine\ORM\Mapping as ORM;
use IServ\Library\Zeit\Time;

class RestPeriod
{
    /**
     * @ORM\Column(name="`end`", type="zeit_time", nullable=false)
     *
     * @var Time
     */
    private $start;
    
    public function getStart(): Time
    {
        return $this->start;
    }
}

use IServ\Bridge\Zeit\Form\Type\ZeitTimeType;
use IServ\Library\Zeit\Time;
use Symfony\Component\Validator\Constraints as Assert;

class RestPeriodData
{
    /**
     * @Assert\NotNull(message="This value is me $start): self
    {
        $this->start = $start;

        return $this;
    }
}

// Somewhere in a controller
$data = new RestPeriodData();

$form = $this->createForm(RestPeriodType::class, $data)
    ->add('start', ZeitTimeType::class, [/* ... */])
    ->getForm()
;