Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 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 = [
10
        '{{lastName}} {{companySuffix}}',
11
        '{{companyPrefix}} {{lastName}} {{companySuffix}}',
12
        '{{companyPrefix}} {{lastName}}',
13
    ];
14
 
15
    protected static $bsWords = [
16
        [],
17
    ];
18
 
19
    protected static $catchPhraseWords = [
20
        ['الخدمات', 'الحلول', 'الانظمة'],
21
        [
22
            'الذهبية', 'الذكية', 'المتطورة', 'المتقدمة', 'الدولية', 'المتخصصه', 'السريعة',
23
            'المثلى', 'الابداعية', 'المتكاملة', 'المتغيرة', 'المثالية',
24
        ],
25
    ];
26
 
27
    protected static $companyPrefix = ['شركة', 'مؤسسة', 'مجموعة', 'مكتب', 'أكاديمية', 'معرض'];
28
 
29
    protected static $companySuffix = ['وأولاده', 'للمساهمة المحدودة', ' ذ.م.م', 'مساهمة عامة', 'وشركائه'];
30
 
31
    /**
32
     * @example 'مؤسسة'
33
     *
34
     * @return string
35
     */
36
    public function companyPrefix()
37
    {
38
        return static::randomElement(self::$companyPrefix);
39
    }
40
 
41
    /**
42
     * @example 'الحلول المتقدمة'
43
     */
44
    public function catchPhrase()
45
    {
46
        $result = [];
47
 
48
        foreach (static::$catchPhraseWords as &$word) {
49
            $result[] = static::randomElement($word);
50
        }
51
 
52
        return implode(' ', $result);
53
    }
54
 
55
    /**
56
     * @example 'integrate extensible convergence'
57
     */
58
    public function bs()
59
    {
60
        $result = [];
61
 
62
        foreach (static::$bsWords as &$word) {
63
            $result[] = static::randomElement($word);
64
        }
65
 
66
        return implode(' ', $result);
67
    }
68
 
69
    /**
70
     * example 7001010101
71
     */
72
    public static function companyIdNumber()
73
    {
74
        $partialValue = static::numerify(700 . str_repeat('#', 6));
75
 
76
        return Luhn::generateLuhnNumber($partialValue);
77
    }
78
}