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
Text.php
5 years ago
Company.php
103 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Faker\Provider\ar_SA; |
| 4 | |
| 5 | use Faker\Calculator\Luhn; |
| 6 | |
| 7 | class Company extends \Faker\Provider\Company |
| 8 | { |
| 9 | protected static $formats = array( |
| 10 | '{{lastName}} {{companySuffix}}', |
| 11 | '{{companyPrefix}} {{lastName}} {{companySuffix}}', |
| 12 | '{{companyPrefix}} {{lastName}}', |
| 13 | ); |
| 14 | |
| 15 | protected static $bsWords = array( |
| 16 | array() |
| 17 | ); |
| 18 | |
| 19 | protected static $catchPhraseWords = array( |
| 20 | array('الخد� |
| 21 | ات','الحلول','الانظ� |
| 22 | ة'), |
| 23 | array( |
| 24 | 'الذهبية','الذكية','ال� |
| 25 | تطورة','ال� |
| 26 | تقد� |
| 27 | ة', 'الدولية', 'ال� |
| 28 | تخصصه', 'السريعة', |
| 29 | 'ال� |
| 30 | ثلى', 'الابداعية', 'ال� |
| 31 | تكا� |
| 32 | لة', 'ال� |
| 33 | تغيرة', 'ال� |
| 34 | ثالية' |
| 35 | ), |
| 36 | ); |
| 37 | |
| 38 | protected static $companyPrefix = array('شركة', '� |
| 39 | ؤسسة', '� |
| 40 | ج� |
| 41 | وعة', '� |
| 42 | كتب', 'أكادي� |
| 43 | ية', '� |
| 44 | عرض'); |
| 45 | |
| 46 | protected static $companySuffix = array('وأولاده', 'لل� |
| 47 | ساه� |
| 48 | ة ال� |
| 49 | حدودة', ' ذ.� |
| 50 | .� |
| 51 | ', '� |
| 52 | ساه� |
| 53 | ة عا� |
| 54 | ة', 'وشركائه'); |
| 55 | |
| 56 | /** |
| 57 | * @example '� |
| 58 | ؤسسة' |
| 59 | * @return string |
| 60 | */ |
| 61 | public function companyPrefix() |
| 62 | { |
| 63 | return static::randomElement(self::$companyPrefix); |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * @example 'الحلول ال� |
| 68 | تقد� |
| 69 | ة' |
| 70 | */ |
| 71 | public function catchPhrase() |
| 72 | { |
| 73 | $result = array(); |
| 74 | foreach (static::$catchPhraseWords as &$word) { |
| 75 | $result[] = static::randomElement($word); |
| 76 | } |
| 77 | |
| 78 | return join(' ', $result); |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * @example 'integrate extensible convergence' |
| 83 | */ |
| 84 | public function bs() |
| 85 | { |
| 86 | $result = array(); |
| 87 | foreach (static::$bsWords as &$word) { |
| 88 | $result[] = static::randomElement($word); |
| 89 | } |
| 90 | |
| 91 | return join(' ', $result); |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * example 7001010101 |
| 96 | **/ |
| 97 | public static function companyIdNumber() |
| 98 | { |
| 99 | $partialValue = static::numerify(700 . str_repeat('#', 6)); |
| 100 | return Luhn::generateLuhnNumber($partialValue); |
| 101 | } |
| 102 | } |
| 103 |