public function byOrganizationAndByKey($organizationId, $key)
  {
    if(empty($databaseConnectionName))
    {
      $databaseConnectionName = $this->databaseConnectionName;
    }

    return $this->Account->setConnection($databaseConnectionName)
      ->where('organization_id', '=', $organizationId)
      ->where('key', '=', $key)->get();
  }
public function byOrganizationAndByKey($organizationId, $key)
  {
    if(empty($databaseConnectionName))
    {
      $databaseConnectionName = $this->databaseConnectionName;
    }

    return $this->Account->setConnection($databaseConnectionName)
      ->where('organization_id', '=', $organizationId)
      ->where('key', '=', $key)->get();
  }
public function byOrganizationAndByKey ( $ organizationId , $ key ) { if ( empty ( $ databaseConnectionName ) ) { $ databaseConnectionName = $ this -> databaseConnectionName ; } return $ this -> Account -> setConnection ( $ databaseConnectionName ) -> where ( 'organization_id' , '=' , $ organizationId ) -> where ( 'key' , '=' , $ key ) -> get ( ) ; }
Retrieve accounts by organization and by key

@param  int $organizationId
@param  string $key

@return Illuminate\Database\Eloquent\Collection
Retrieve accounts by organization and by key