for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @package Faker
* @author Iurii Makukh <[email protected]>
* @copyright Copyright (c) 2017, Iurii Makukh <[email protected]>
* @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU General Public License 3.0
*/
namespace gplcart\modules\faker\models\generators;
use gplcart\core\models\Zone as ZoneModel;
use gplcart\modules\faker\models\Generator as FakerModuleGenerator;
* Manages basic behaviors and data related to geo zones
class Zone extends FakerModuleGenerator
{
* Zone model class instance
* @var \gplcart\core\models\Zone $zone
protected $zone;
* @param ZoneModel $zone
public function __construct(ZoneModel $zone)
parent::__construct();
$this->zone = $zone;
}
* Returns the generator name
* @return string
public function getName()
return $this->translation->text('Zone');
* Generate a single zone
* @return bool
public function create()
$data = array(
'status' => $this->faker->boolean(),
'title' => $this->faker->country() . ', ' . $this->faker->state()
);
return (bool) $this->zone->add($data);