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