定制 lyssal/simple-location-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lyssal/simple-location-bundle

Composer 安装命令:

composer require lyssal/simple-location-bundle

包简介

The simple location bundle permits create dynamic typed locations (countries, cities, etc).

README 文档

README

The simple location bundle permits create dynamic typed locations.

Installation

composer require lyssal/simple-location-bundle

Usage

Create your Location entity

namespace App\Entity\Location;

use Doctrine\ORM\Mapping as ORM;
use Lyssal\SimpleLocationBundle\Doctrine\Repository\LocationRepository;
use Lyssal\SimpleLocationBundle\Entity\Location as LyssalLocation;

#[ORM\Entity(repositoryClass: LocationRepository::class)]
class Location extends LyssalLocation
{
    // If you want to add properties
}

Exemples of use

$continent = (new LocationType())->setName('Continent');
$country = (new LocationType())->setName('Country')->addParent($continent);
$city = (new LocationType())->setName('City')->addParent($country);

$europa = (new Location())->setName('Europe')->setType($continent);
$america = (new Location())->setName('America')->setType($continent);
$asia = (new Location())->setName('Asia')->setType($continent);

$france = (new Location())->setName('France')->setType($country)->addParent($europa);
$italy = (new Location())->setName('Italy')->setType($country)->addParent($europa);
$sovietUnion = (new Location())->setName('Soviet Union')->setType($country)->addParent($europa)->addParent($asia);

$paris = (new Location())->setName('Paris')->setType($city)->addParent($france);

$countrySet = (new LocationType())->setName('Country set')->addChild($country);

$northAmerica = (new Location())->setName('North America')->setType($countrySet)->addParent($america);
$usa = (new Location())->setName('United States of America')->setType($country)->addParent($america)->addParent($northAmerica);

$europeanUnion = (new Location())->setName('European Union')->setType($countrySet)->addParent($europa)->addChild($france)->addChild($italy);

$germany = (new Location())->setName('Germany')->setType($country)->addParent($europa)->addParent($europeanUnion);
$westGermany = (new Location())->setName('Federal Republic of Germany')->setType($country)->addParent($germany)->addParent($europa)->addParent($europeanUnion);
$eastGermany = (new Location())->setName('German Democratic Republic')->setType($country)->addParent($sovietUnion)->addParent($germany)->addParent($europa);

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固