| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | protected function execute() |
||
| 16 | { |
||
| 17 | $this->entityId = $this->mapper->getEntityPk($this->entity); |
||
| 18 | $this->entityState = $this->entity->getPersistenceState(); |
||
| 19 | |||
| 20 | $connection = $this->mapper->getWriteConnection(); |
||
| 21 | |||
| 22 | $columns = array_merge( |
||
| 23 | $this->mapper->extractFromEntity($this->entity), |
||
| 24 | $this->extraColumns, |
||
| 25 | $this->mapper->getGuards() |
||
| 26 | ); |
||
| 27 | $columns = Arr::except($columns, $this->mapper->getPrimaryKey()); |
||
| 28 | |||
| 29 | $insertSql = new \Sirius\Sql\Insert($connection); |
||
| 30 | $insertSql->into($this->mapper->getTable()) |
||
| 31 | ->columns($columns); |
||
| 32 | $insertSql->perform(); |
||
| 33 | $this->mapper->setEntityPk($this->entity, $connection->lastInsertId()); |
||
| 34 | } |
||
| 45 |