15 private static $_domain_suffix = array(
'co.uk',
'com',
'us',
'org',
'ca',
'biz',
'info',
'name');
16 private static $_free = array(
'gmail.com',
'googlemail.com',
'yahoo.com',
'hotmail.com',
'hotmail.co.uk');
17 private static $_name_formats = array(array(
'first_name'),array(
'first_name',
'surname'));
19 public function __construct()
23 public function __get( $var )
25 if ( strpos( $var,
"(" ) && strpos( $var,
")" ) ) {
32 public function domain_suffix()
37 public function domain_word()
39 $result = explode(
' ', parent::__get(
'Company')->name );
41 $result = strtolower( $result );
42 $result = preg_replace(
"/\W/",
'', $result );
46 public function domain_name()
48 $result[] = $this->domain_word;
49 $result[] = $this->domain_suffix;
50 return join( $result,
'.' );
53 public function user_name( $name = null )
56 return $this->sanitise_name( $name );
60 $n = parent::__get(
'Name');
63 foreach ( $a as $method ) {
68 $na = join(
' ', $na );
69 $result = $this->sanitise_name( $na );
73 public function email( $name = null)
75 return join( array( $this->user_name($name), $this->domain_name() ),
"@" );
78 public function free_email( $name = null)
80 return join( array( $this->user_name($name), parent::random( self::$_free ) ),
"@" );
83 protected function sanitise_name( $name )
85 $name = strtolower( $name );
86 $n = explode(
' ', $name );
87 $n = preg_replace(
"/\W/",
"", $n);
88 $d = array(
'.',
'_');
91 return join( $n, parent::random( $d ) );