src/ChickenWire/Model.php
private static function _initializeCW($table)
		{

			// Is it an auth model?
			if (isset(static::$authModel) && static::$authModel !== false) {

				// Get my full class name
				$myClass = trim(get_called_class(), '\\ ');
				
				// Look up the auth object
				$myAuth = null;
				foreach (Auth::all() as $auth) {
					if (trim($auth->model, '\\ ') == $myClass) {
						$myAuth = $auth;
						break;
					}

				}
				
				// Still null?
				if (is_null($myAuth)) {

					// Not good...
					throw new \Exception("There was no Auth defined with model '" . $myClass . "'.", 1);					

				}

				// Store it
				self::$auth = $myAuth;

				// Register auth save callback
				$table->callback->register("beforeSave", function (\ActiveRecord\Model $model) { 
					$model->_setAuthValues();
				});

			}

			
		}
private static function _initializeCW($table)
		{

			// Is it an auth model?
			if (isset(static::$authModel) && static::$authModel !== false) {

				// Get my full class name
				$myClass = trim(get_called_class(), '\\ ');
				
				// Look up the auth object
				$myAuth = null;
				foreach (Auth::all() as $auth) {
					if (trim($auth->model, '\\ ') == $myClass) {
						$myAuth = $auth;
						break;
					}

				}
				
				// Still null?
				if (is_null($myAuth)) {

					// Not good...
					throw new \Exception("There was no Auth defined with model '" . $myClass . "'.", 1);					

				}

				// Store it
				self::$auth = $myAuth;

				// Register auth save callback
				$table->callback->register("beforeSave", function (\ActiveRecord\Model $model) { 
					$model->_setAuthValues();
				});

			}

			
		}
private static function _initializeCW ( $ table ) { // Is it an auth model? if ( isset ( static :: $ authModel ) && static :: $ authModel !== false ) { // Get my full class name $ myClass = trim ( get_called_class ( ) , '\\ ' ) ; // Look up the auth object $ myAuth = null ; foreach ( Auth :: all ( ) as $ auth ) { if ( trim ( $ auth -> model , '\\ ' ) == $ myClass ) { $ myAuth = $ auth ; break ; } } // Still null? if ( is_null ( $ myAuth ) ) { // Not good... throw new \ Exception ( "There was no Auth defined with model '" . $ myClass . "'." , 1 ) ; } // Store it self :: $ auth = $ myAuth ; // Register auth save callback $ table -> callback -> register ( "beforeSave" , function ( \ ActiveRecord \ Model $ model ) { $ model -> _setAuthValues ( ) ; } ) ; } }
Initialize ChickenWire featues
@param  \ActiveRecord\Table   The Table object to work with
@return void
Initialize ChickenWire featues