예제 #1
0
파일: Db.php 프로젝트: hitechdk/Codeception
 private function addInsertedRow($table, array $row, $id)
 {
     $primaryKey = $this->driver->getPrimaryKey($table);
     $primary = [];
     if ($primaryKey) {
         if ($id && count($primaryKey) === 1) {
             $primary[$primaryKey[0]] = $id;
         } else {
             foreach ($primaryKey as $column) {
                 if (isset($row[$column])) {
                     $primary[$column] = $row[$column];
                 } else {
                     throw new \InvalidArgumentException('Primary key field ' . $column . ' is not set for table ' . $table);
                 }
             }
         }
     } else {
         $primary = $row;
     }
     $this->insertedRows[] = ['table' => $table, 'primary' => $primary];
 }