Address.php
5 years ago
Color.php
5 years ago
Company.php
5 years ago
Internet.php
5 years ago
Payment.php
5 years ago
Person.php
5 years ago
PhoneNumber.php
5 years ago
Text.php
5 years ago
Company.php
76 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Faker\Provider\kk_KZ; |
| 4 | |
| 5 | class Company extends \Faker\Provider\Company |
| 6 | { |
| 7 | protected static $companyNameFormats = array( |
| 8 | '{{companyPrefix}} {{companyNameElement}}', |
| 9 | '{{companyPrefix}} {{companyNameElement}}{{companyNameElement}}', |
| 10 | '{{companyPrefix}} {{companyNameElement}}{{companyNameElement}}{{companyNameElement}}', |
| 11 | '{{companyPrefix}} {{companyNameElement}}{{companyNameElement}}{{companyNameElement}}{{companyNameSuffix}}', |
| 12 | ); |
| 13 | |
| 14 | protected static $companyPrefixes = array( |
| 15 | 'АҚ', 'ЖШС', 'ЖАҚ' |
| 16 | ); |
| 17 | |
| 18 | protected static $companyNameSuffixes = array( |
| 19 | 'Құрылыс', 'Машина', 'Бұзу', '-М', 'Лизинг', 'Стра� |
| 20 | ', 'Ком', 'Телеком' |
| 21 | ); |
| 22 | |
| 23 | protected static $companyElements = array( |
| 24 | 'Қазақ', 'Кітап', 'Цемент', 'Лифт', 'Креп', 'Авто', 'Теле', 'Транс', 'Алмаз', 'Метиз', |
| 25 | 'Мотор', 'Қаз', 'Те� |
| 26 | ', 'Санте� |
| 27 | ', 'Алматы', 'Астана', 'Электро', |
| 28 | ); |
| 29 | |
| 30 | /** |
| 31 | * @example 'ЖШС АлматыТелеком' |
| 32 | */ |
| 33 | public function company() |
| 34 | { |
| 35 | $format = static::randomElement(static::$companyNameFormats); |
| 36 | |
| 37 | return $this->generator->parse($format); |
| 38 | } |
| 39 | |
| 40 | public static function companyPrefix() |
| 41 | { |
| 42 | return static::randomElement(static::$companyPrefixes); |
| 43 | } |
| 44 | |
| 45 | public static function companyNameElement() |
| 46 | { |
| 47 | return static::randomElement(static::$companyElements); |
| 48 | } |
| 49 | |
| 50 | public static function companyNameSuffix() |
| 51 | { |
| 52 | return static::randomElement(static::$companyNameSuffixes); |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * National Business Identification Numbers |
| 57 | * |
| 58 | * @link http://egov.kz/wps/portal/Content?contentPath=%2Fegovcontent%2Fbus_business%2Ffor_businessmen%2Farticle%2Fbusiness_identification_number&lang=en |
| 59 | * @param \DateTime $registrationDate |
| 60 | * @return string 12 digits, like 150140000019 |
| 61 | */ |
| 62 | public static function businessIdentificationNumber(\DateTime $registrationDate = null) |
| 63 | { |
| 64 | if (!$registrationDate) { |
| 65 | $registrationDate = \Faker\Provider\DateTime::dateTimeThisYear(); |
| 66 | } |
| 67 | |
| 68 | $dateAsString = $registrationDate->format('ym'); |
| 69 | $legalEntityType = (string) static::numberBetween(4, 6); |
| 70 | $legalEntityAdditionalType = (string) static::numberBetween(0, 3); |
| 71 | $randomDigits = (string) static::numerify('######'); |
| 72 | |
| 73 | return $dateAsString . $legalEntityType . $legalEntityAdditionalType . $randomDigits; |
| 74 | } |
| 75 | } |
| 76 |