Subversion Repositories php_users

Rev

Rev 21 | Rev 42 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21 Rev 32
Line 130... Line 130...
130
       */
130
       */
131
      public function __construct( $connection, $customFields = array() ) {
131
      public function __construct( $connection, $customFields = array() ) {
132
         parent::__construct( $customFields );
132
         parent::__construct( $customFields );
133
         if ( is_array( $connection ) ) { // they sent us some login values
133
         if ( is_array( $connection ) ) { // they sent us some login values
134
            $this->setDBConnection( $connection );
134
            $this->setDBConnection( $connection );
135
         } elseif ( get_class( $connection ) == 'mysqli' ) {
135
         } elseif ( $connection instanceof mysqli ) { // mysqli, or some extension
136
            $this->dbConnection = $connection;
136
            $this->dbConnection = $connection;
137
         } else {
137
         } else {
138
            throw new Exception( 'Can not open database using; must give open mysqli class or array of login information' );
138
            throw new Exception( 'Can not open database using; must give open mysqli class or array of login information' );
139
         }
139
         }
140
      }
140
      }