objectManager = $objectManager; $this->type = $type; } /** * Create class instance with specified parameters * * @param array $arguments * @return Queue * @throws LocalizedException */ public function create(array $arguments = []) { $queue = $this->objectManager->create($this->type, $arguments); if (!$queue instanceof Queue) { throw new LocalizedException( new Phrase("Wrong queue type specified.") ); } return $queue; } }