Пример #1
0
 public function testQualifyFieldsNames()
 {
     // Without database name
     $this->assertCount(0, array_diff(['user.id'], UtilMySql::qualifyFieldsNames(['id'], 'user')));
     $this->assertCount(0, array_diff(['user.id', 'user.login'], UtilMySql::qualifyFieldsNames(['id', 'login'], 'user')));
     $this->assertCount(0, array_diff(['user.id', 'user.login'], UtilMySql::qualifyFieldsNames(['user.id', 'login'], 'user')));
     $this->assertCount(0, array_diff(['db.user.id', 'user.login'], UtilMySql::qualifyFieldsNames(['db.user.id', 'login'], 'user')));
     // With database name
     $this->assertCount(0, array_diff(['prod.user.id'], UtilMySql::qualifyFieldsNames(['id'], 'user', 'prod')));
     $this->assertCount(0, array_diff(['prod.user.id', 'prod.user.login'], UtilMySql::qualifyFieldsNames(['id', 'login'], 'user', 'prod')));
     $this->assertCount(0, array_diff(['prod.user.id', 'prod.user.login'], UtilMySql::qualifyFieldsNames(['user.id', 'login'], 'user', 'prod')));
     $this->assertCount(0, array_diff(['prod.user.id', 'prod.user.login'], UtilMySql::qualifyFieldsNames(['prod.user.id', 'login'], 'user', 'prod')));
 }
Пример #2
0
 /**
  * Create the SQL request from the request's template.
  * @return string The method returns a string that represents the SQL request.
  */
 private function __sql()
 {
     return UtilMySql::developSql($this->__sql, $this->getDatabaseSchema(), true, true);
 }
Пример #3
0
 /**
  * Create the SQL request from the request's template.
  * @return string The method returns a string that represents the SQL request.
  */
 private function __sql()
 {
     $sql = UtilMySql::developSql($this->__sql, $this->getDatabaseSchema(), true, true);
     return str_replace('__V__', OutputValues::OUTPUT_VALUE_IS_AUTHENTICATED, $sql);
 }