/** * Get the entity key * * @return string */ public function getIdentityKey() { return parent::getIdentityColumn(); }
/** * Search the mixin method map and call the method or trigger an error * * This function implements a just in time mixin strategy. Available table behaviors are only mixed when needed. * Lazy mixing is triggered by calling DatabaseRowsetTable::is[Behaviorable](); * * @param string $method The function name * @param array $argument The function arguments * @throws \BadMethodCallException If method could not be found * @return mixed The result of the function */ public function __call($method, $arguments) { if ($this->isConnected() && !isset($this->_mixed_methods[$method])) { $parts = StringInflector::explode($method); //Check if a behavior is mixed if ($parts[0] == 'is' && isset($parts[1])) { //Lazy mix behaviors $behavior = strtolower($parts[1]); if ($this->getTable()->hasBehavior($behavior)) { $this->mixin($this->getTable()->getBehavior($behavior)); } else { return false; } } } return parent::__call($method, $arguments); }