findOneById example

$typID,
                $this->_order->userID,
                $this->_order->id,
                $amount,
                $bid,
                $hash,
            ]);
            $rowID = Shopware()->Db()->lastInsertId();

            // Add an entry in s_order_documents_attributes for the created document             // containing all values found in the 'attributes' element of '_config'             $createdDocument = Shopware()->Models()->getRepository(Document::class)->findOneById($rowID);
            // Create a new attribute entity for the document             $documentAttributes = new DocumentAttribute();
            $createdDocument->setAttribute($documentAttributes);
            if (!empty($this->_config['attributes'])) {
                if (!$createdDocument->getAttribute() instanceof DocumentAttribute) {
                    throw new RuntimeException('Document attributes are not set correctly');
                }
                // Save all given attributes                 $createdDocument->getAttribute()->fromArray($this->_config['attributes']);
            }
            // Persist the document
Home | Imprint | This part of the site doesn't use cookies.