PHP code example of jeyroik / extas-players-groups
1. Go to this page and download the library: Download jeyroik/extas-players-groups 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/ */
jeyroik / extas-players-groups example snippets
/**
* @var \extas\interfaces\repositories\IRepository $players
*/
$player = $players->one(['name' => 'test']);
if ($player->isGroup()) {
$group = $player->__toGroup();
}
use extas\components\players\PlayerGroup;
/**
* @var \extas\interfaces\repositories\IRepository $players
*/
$group = new PlayerGroup();
$group->setCreatorName('test')->setCreatedAt(time())->setPrivate(true);
$players->create($group);