/** * Find the appropriate DB connection for this model */ protected function initConnection() { // Check connection property on the model if ($connection = $this->class->getStaticPropertyValue('connection', null)) { // Get that connection $this->connection = ChickenWire::DB($connection); } else { // Get default connection $this->connection = ChickenWire::DB(); } }