type = 0; StockMapper::create()->execute($stock); $stockLocation = new StockLocation((string) ($stock->id . '-1')); $stockLocation->stock = $stock; StockLocationMapper::create()->execute($stockLocation); } }