public function setUp($connectionName = null) { parent::setUp($connectionName); Event::$belongsTo = array(array('venue'), array('host')); Venue::$hasMany = array(array('events', 'order' => 'id asc'), array('hosts', 'through' => 'events', 'order' => 'hosts.id asc')); Venue::$hasOne = array(); Employee::$hasOne = array(array('position')); Host::$hasMany = array(array('events', 'order' => 'id asc')); foreach ($this->relationshipNames as $name) { if (preg_match("/{$name}/i", $this->getName())) { $this->relationshipName = $name; } } }