Skip to content

BoatraceVentureProject/Prefecture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prefecture in the Boatrace Venture Project

Build Status codecov Latest Stable Version Latest Unstable Version License

Installation

composer require bvp/prefecture

Usage

<?php

require __DIR__ . '/vendor/autoload.php';

use Boatrace\Venture\Project\Prefecture;

$collection = Prefecture::byId(13);
var_dump($collection->get('id')); // int(13)
var_dump($collection->get('name')); // string(9) "東京都"
var_dump($collection->get('short_name')); // string(6) "東京"
var_dump($collection->get('hiragana_name')); // string(18) "とうきょうと"
var_dump($collection->get('katakana_name')); // string(18) "トウキョウト"
var_dump($collection->get('english_name')); // string(5) "tokyo"

$collection = Prefecture::byName('東京都');
var_dump($collection->get('id')); // int(13)
var_dump($collection->get('name')); // string(9) "東京都"
var_dump($collection->get('short_name')); // string(6) "東京"
var_dump($collection->get('hiragana_name')); // string(18) "とうきょうと"
var_dump($collection->get('katakana_name')); // string(18) "トウキョウト"
var_dump($collection->get('english_name')); // string(5) "tokyo"

$collection = Prefecture::byShortName('東京');
var_dump($collection->get('id')); // int(13)
var_dump($collection->get('name')); // string(9) "東京都"
var_dump($collection->get('short_name')); // string(6) "東京"
var_dump($collection->get('hiragana_name')); // string(18) "とうきょうと"
var_dump($collection->get('katakana_name')); // string(18) "トウキョウト"
var_dump($collection->get('english_name')); // string(5) "tokyo"

$collection = Prefecture::byHiraganaName('とうきょうと');
var_dump($collection->get('id')); // int(13)
var_dump($collection->get('name')); // string(9) "東京都"
var_dump($collection->get('short_name')); // string(6) "東京"
var_dump($collection->get('hiragana_name')); // string(18) "とうきょうと"
var_dump($collection->get('katakana_name')); // string(18) "トウキョウト"
var_dump($collection->get('english_name')); // string(5) "tokyo"

$collection = Prefecture::byKatakanaName('トウキョウト');
var_dump($collection->get('id')); // int(13)
var_dump($collection->get('name')); // string(9) "東京都"
var_dump($collection->get('short_name')); // string(6) "東京"
var_dump($collection->get('hiragana_name')); // string(18) "とうきょうと"
var_dump($collection->get('katakana_name')); // string(18) "トウキョウト"
var_dump($collection->get('english_name')); // string(5) "tokyo"

$collection = Prefecture::byEnglishName('tokyo');
var_dump($collection->get('id')); // int(13)
var_dump($collection->get('name')); // string(9) "東京都"
var_dump($collection->get('short_name')); // string(6) "東京"
var_dump($collection->get('hiragana_name')); // string(18) "とうきょうと"
var_dump($collection->get('katakana_name')); // string(18) "トウキョウト"
var_dump($collection->get('english_name')); // string(5) "tokyo"

License

Prefecture in the Boatrace Venture Project is open source software licensed under the MIT license.