Skip to content

Instantly share code, notes, and snippets.

@AD7six
Last active December 15, 2015 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AD7six/659715af1699ab0569fe to your computer and use it in GitHub Desktop.
Save AD7six/659715af1699ab0569fe to your computer and use it in GitHub Desktop.
<?php
...
public function __construct($id = false, $table = null, $ds = null) {
parent::__construct($id, $table, $ds);
if ((PHP_SAPI !== 'cli' && !defined('CORE_TEST_CASES')) && get_class($this) === 'AppModel') {
throw new \Exception(sprintf(
'AppModel was initialized for "%s" (table "%s"), either the model doesn\'t exist or there is a reference to it using a different plugin.',
$this->alias,
$this->table
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment