This commit is contained in:
2020-09-11 16:27:08 +08:00
parent 3bbd3e7c4e
commit b9a017571f
3 changed files with 48 additions and 59 deletions
+4 -5
View File
@@ -26,7 +26,7 @@ class Change extends BaseObject
* @return string
* @throws Exception
*/
public function update($model, $attributes, $condition, &$params)
public function update(string $model, $attributes, $condition, &$params)
{
if (empty($params)) {
throw new Exception("Not has update values.");
@@ -109,7 +109,7 @@ class Change extends BaseObject
* @return array
* @throws Exception
*/
private function assemble($params, $op, $_tmp)
private function assemble($params, $op, array $_tmp)
{
$message = 'Incr And Decr action. The value must a numeric.';
foreach ($params as $key => $val) {
@@ -247,7 +247,7 @@ class Change extends BaseObject
* @return string
* @throws Exception
*/
public function delete($query)
public function delete(ActiveQuery $query)
{
if (empty($query->from)) {
$query->from = $query->getTable();
@@ -265,9 +265,8 @@ class Change extends BaseObject
/**
* @param string $tableName
* @return string
* @throws
*/
public function truncate($tableName)
public function truncate(string $tableName)
{
return 'TRUNCATE ' . $tableName;
}