Advertisement
dberry

Model_Profile

Dec 15th, 2011
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.18 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Model_Profile
  4.  *
  5.  * Extends \Warden\Model_Profile
  6.  *
  7.  * @package    Warden
  8.  * @subpackage OmniAuth
  9.  *
  10.  * @author Phil Sturgeon, Modified by Andrew Wayne
  11.  */
  12.  
  13. class Model_Profile extends \Warden\Model_Profile
  14. {
  15.     /**
  16.      * Validation regular expression for a name
  17.      */
  18.     const REGEX_NAME = '\^[^;]+$';
  19.  
  20.     /**
  21.      * Object properties
  22.      *
  23.      * @var array
  24.      */
  25.     protected static $_properties = array(
  26.         'id',
  27.         'user_id',
  28.         // Example fields
  29.         'first_name' => array(
  30.             'validation' => array(
  31.                 'null' => true,
  32.                 'match_pattern' => array(self::REGEX_NAME),
  33.               ),
  34.         ),
  35.         'last_name' => array(
  36.             'validation' => array(
  37.                 'null' => true,
  38.                 'match_pattern' => array(self::REGEX_NAME),
  39.             ),
  40.         ),
  41.         'title',
  42.         'city',
  43.         'state',
  44.         'zipcode',
  45.         'country',
  46.         'created_at',
  47.         'updated_at',
  48.     );
  49.  
  50.     /**
  51.      * Observer classes to use
  52.      *
  53.      * @var array
  54.      */
  55.     protected static $_observers = array(
  56.         'Warden\\Observer_Timestamps'
  57.     );
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement