public function checkSourceActive($userId)
    {
        // The only method to check if it is active is by getting all the tables,
        // since the surveys table may be empty so we just check for existence.
        $sourceDb  = $this->getSourceDatabase();
        $tables    = array_map('strtolower', $sourceDb->listTables());
        $tableName = $this->addDatabasePrefix(self::SURVEYS_TABLE, false); // Get name without database prefix.

        $active = strtolower(in_array($tableName, $tables));

        $values['gso_active'] = $active ? 1 : 0;
        $values['gso_status'] = $active ? 'Active' : 'Inactive';

        $this->_updateSource($values, $userId);

        return $active;
    }
public function checkSourceActive($userId)
    {
        // The only method to check if it is active is by getting all the tables,
        // since the surveys table may be empty so we just check for existence.
        $sourceDb  = $this->getSourceDatabase();
        $tables    = array_map('strtolower', $sourceDb->listTables());
        $tableName = $this->addDatabasePrefix(self::SURVEYS_TABLE, false); // Get name without database prefix.

        $active = strtolower(in_array($tableName, $tables));

        $values['gso_active'] = $active ? 1 : 0;
        $values['gso_status'] = $active ? 'Active' : 'Inactive';

        $this->_updateSource($values, $userId);

        return $active;
    }
public function checkSourceActive ( $ userId ) { // The only method to check if it is active is by getting all the tables, // since the surveys table may be empty so we just check for existence. $ sourceDb = $ this -> getSourceDatabase ( ) ; $ tables = array_map ( 'strtolower' , $ sourceDb -> listTables ( ) ) ; $ tableName = $ this -> addDatabasePrefix ( self :: SURVEYS_TABLE , false ) ; // Get name without database prefix. $ active = strtolower ( in_array ( $ tableName , $ tables ) ) ; $ values [ 'gso_active' ] = $ active ? 1 : 0 ; $ values [ 'gso_status' ] = $ active ? 'Active' : 'Inactive' ; $ this -> _updateSource ( $ values , $ userId ) ; return $ active ; }
Check if the tableprefix exists in the source database, and change the status of this
adapter in the gems_sources table accordingly

@param int $userId    Id of the user who takes the action (for logging)
@return boolean  True if the source is active
Check if the tableprefix exists in the source database and change the status of this adapter in the gems_sources table accordingly