1. Go to this page and download the library: Download carrooi/labels 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/ */
carrooi / labels example snippets
namespace App\Model\Entities;
use Carrooi\Labels\Model\Entities\ILabelOwner;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @author David Kudera
*/
class User implements ILabelOwner
{
// ...
/**
* @return int
*/
public function getId()
{
return $this->id;
}
}
namespace App\Model\Entities;
use Carrooi\Labels\Model\Entities\ILabelItem;
use Carrooi\Labels\Model\Entities\TLabelItem;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @author David Kudera
*/
class LabelItem implements ILabelItem
{
use TLabelItem;
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @var int
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="\App\Model\Entities\Mail")
* @var \App\Model\Entities\Mail
*/
private $mail;
/**
* @ORM\ManyToOne(targetEntity="\App\Model\Entities\Article")
* @var \App\Model\Entities\Article
*/
private $article;
/**
* @return int
*/
public function getId()
{
return $this->id;
}
// ... other getters and setters for mail and article fields
}
namespace CarrooiTests\LabelsApp\Model\Entities;
use Carrooi\Labels\Model\Entities\ILabelableEntity;
use Carrooi\Labels\Model\Entities\TLabelable;
use Kdyby\Doctrine\Entities\Attributes\Identifier;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @author David Kudera
*/
class Article implements ILabelableEntity
{
use TLabelable;
// ... your own fields
/**
* @return int
*/
public function getId()
{
return $this->id;
}
// ... some other getters and setters
}