Skip to content

Commit 4b09d05

Browse files
authored
Merge branch 'develop' into german_translations
2 parents 9879eb2 + 0247b4c commit 4b09d05

File tree

92 files changed

+5706
-2279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+5706
-2279
lines changed

Api/Data/QueueArchiveInterface.php

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
<?php
2+
3+
namespace Algolia\AlgoliaSearch\Api\Data;
4+
5+
/**
6+
* Interface QueueArchiveInterface
7+
* @package Algolia\AlgoliaSearch\Api\Data
8+
*/
9+
interface QueueArchiveInterface
10+
{
11+
const ARCHIVE_ID = 'archive_id';
12+
const PID = 'pid';
13+
const CLASS_NAME = 'class';
14+
const METHOD_NAME = 'method';
15+
const DATA = 'data';
16+
const RETRIES = 'retries';
17+
const ERROR_LOG = 'error_log';
18+
const DATA_SIZE = 'data_size';
19+
const IS_FULL_REINDEX = 'is_full_reindex';
20+
const CREATED_AT = 'created_at';
21+
const PROCESSED_AT = 'processed_at';
22+
const SUCCESS = 'success';
23+
const DEBUG = 'debug';
24+
25+
/**
26+
* Get archive ID
27+
*
28+
* @return int|null
29+
*/
30+
public function getArchiveId();
31+
32+
/**
33+
* Set archive ID
34+
*
35+
* @param int $id
36+
* @return $this
37+
*/
38+
public function setArchiveId($id);
39+
40+
/**
41+
* Get PID
42+
*
43+
* @return int|null
44+
*/
45+
public function getPid();
46+
47+
/**
48+
* Set PID
49+
*
50+
* @param int $pid
51+
* @return $this
52+
*/
53+
public function setPid($pid);
54+
55+
/**
56+
* Get class name
57+
*
58+
* @return string|null
59+
*/
60+
public function getClassName();
61+
62+
/**
63+
* Set class name
64+
*
65+
* @param string $className
66+
* @return $this
67+
*/
68+
public function setClassName($className);
69+
70+
/**
71+
* Get method name
72+
*
73+
* @return string|null
74+
*/
75+
public function getMethodName();
76+
77+
/**
78+
* Set method name
79+
*
80+
* @param string $methodName
81+
* @return $this
82+
*/
83+
public function setMethodName($methodName);
84+
85+
/**
86+
* Get data field
87+
*
88+
* @return string|null
89+
*/
90+
public function getDataField();
91+
92+
/**
93+
* Set data field
94+
*
95+
* @param string $dataField
96+
* @return $this
97+
*/
98+
public function setDataField($dataField);
99+
100+
/**
101+
* Get retries
102+
*
103+
* @return int
104+
*/
105+
public function getRetries();
106+
107+
/**
108+
* Set retries
109+
*
110+
* @param int $retries
111+
* @return $this
112+
*/
113+
public function setRetries($retries);
114+
115+
/**
116+
* Get error log
117+
*
118+
* @return string|null
119+
*/
120+
public function getErrorLog();
121+
122+
/**
123+
* Set error log
124+
*
125+
* @param string $errorLog
126+
* @return $this
127+
*/
128+
public function setErrorLog($errorLog);
129+
130+
/**
131+
* Get data size
132+
*
133+
* @return int|null
134+
*/
135+
public function getDataSize();
136+
137+
/**
138+
* Set data size
139+
*
140+
* @param int $dataSize
141+
* @return $this
142+
*/
143+
public function setDataSize($dataSize);
144+
145+
/**
146+
* Get whether the job is part of a full reindex
147+
*
148+
* @return bool
149+
*/
150+
public function getIsFullReindex();
151+
152+
/**
153+
* Set whether the job is part of a full reindex
154+
*
155+
* @param bool $isFullReindex
156+
* @return $this
157+
*/
158+
public function setIsFullReindex($isFullReindex);
159+
160+
/**
161+
* Get creation date and time
162+
*
163+
* @return string
164+
*/
165+
public function getCreatedAt();
166+
167+
/**
168+
* Set creation date and time
169+
*
170+
* @param string $createdAt
171+
* @return $this
172+
*/
173+
public function setCreatedAt($createdAt);
174+
175+
/**
176+
* Get processing date and time
177+
*
178+
* @return string|null
179+
*/
180+
public function getProcessedAt();
181+
182+
/**
183+
* Set processing date and time
184+
*
185+
* @param string $processedAt
186+
* @return $this
187+
*/
188+
public function setProcessedAt($processedAt);
189+
190+
/**
191+
* Get whether the job was successful
192+
*
193+
* @return bool
194+
*/
195+
public function getSuccess();
196+
197+
/**
198+
* Set whether the job was successful
199+
*
200+
* @param bool $success
201+
* @return $this
202+
*/
203+
public function setSuccess($success);
204+
205+
/**
206+
* Get debug info
207+
*
208+
* @return string|null
209+
*/
210+
public function getDebug();
211+
212+
/**
213+
* Set debug info
214+
*
215+
* @param string $debug
216+
* @return $this
217+
*/
218+
public function setDebug($debug);
219+
}
220+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
namespace Algolia\AlgoliaSearch\Api;
4+
5+
use Algolia\AlgoliaSearch\Api\Data\QueueArchiveInterface;
6+
use Magento\Framework\Api\SearchCriteriaInterface;
7+
use Magento\Framework\Api\SearchResultsInterface;
8+
9+
/**
10+
* Interface QueueArchiveRepositoryInterface
11+
* @package Algolia\AlgoliaSearch\Api
12+
*/
13+
interface QueueArchiveRepositoryInterface
14+
{
15+
/**
16+
* Save queue archive
17+
*
18+
* @param QueueArchiveInterface $queueArchive
19+
* @return QueueArchiveInterface
20+
* @throws \Magento\Framework\Exception\LocalizedException
21+
*/
22+
public function save(QueueArchiveInterface $queueArchive);
23+
24+
/**
25+
* Retrieve queue archive by id
26+
*
27+
* @param int $id
28+
* @return QueueArchiveInterface
29+
* @throws \Magento\Framework\Exception\LocalizedException
30+
*/
31+
public function getById($id);
32+
33+
/**
34+
* Retrieve queue archives matching the specified criteria
35+
*
36+
* @param SearchCriteriaInterface $searchCriteria
37+
* @return SearchResultsInterface
38+
* @throws \Magento\Framework\Exception\LocalizedException
39+
*/
40+
public function getList(SearchCriteriaInterface $searchCriteria);
41+
42+
/**
43+
* Delete queue archive
44+
*
45+
* @param QueueArchiveInterface $queueArchive
46+
* @return bool true on success
47+
* @throws \Magento\Framework\Exception\LocalizedException
48+
*/
49+
public function delete(QueueArchiveInterface $queueArchive);
50+
51+
/**
52+
* Delete queue archive by ID
53+
*
54+
* @param int $id
55+
* @return bool true on success
56+
* @throws \Magento\Framework\Exception\NoSuchEntityException
57+
* @throws \Magento\Framework\Exception\LocalizedException
58+
*/
59+
public function deleteById($id);
60+
}

Block/Adminhtml/QueueArchive/View.php

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
3+
namespace Algolia\AlgoliaSearch\Block\Adminhtml\QueueArchive;
4+
5+
use Magento\Backend\Block\Widget\Button;
6+
use Magento\Framework\Registry;
7+
use Magento\Framework\View\Element\Template;
8+
use Magento\Framework\View\Element\Template\Context;
9+
10+
class View extends Template
11+
{
12+
/** @var Registry */
13+
protected $coreRegistry;
14+
15+
/**
16+
* @param Context $context
17+
* @param Registry $coreRegistry
18+
* @param array $data
19+
*/
20+
public function __construct(
21+
Context $context,
22+
Registry $coreRegistry,
23+
array $data = []
24+
) {
25+
parent::__construct($context, $data);
26+
27+
$this->coreRegistry = $coreRegistry;
28+
}
29+
30+
/** @inheritdoc */
31+
protected function _prepareLayout()
32+
{
33+
/** @var Button $button */
34+
$button = $this->getLayout()->createBlock(Button::class);
35+
$button->setData(
36+
[
37+
'label' => __('Back'),
38+
'onclick' => 'setLocation(\'' . $this->getBackUrl() . '\')',
39+
'class' => 'back',
40+
]
41+
);
42+
43+
$this->getToolbar()->setChild('back_button', $button);
44+
45+
return parent::_prepareLayout();
46+
}
47+
48+
/** @return \Algolia\AlgoliaSearch\Model\QueueArchive */
49+
public function getCurrentJob()
50+
{
51+
return $this->coreRegistry->registry('current_job');
52+
}
53+
54+
/** @return string */
55+
public function getBackUrl()
56+
{
57+
return $this->getUrl('*/*/index');
58+
}
59+
60+
/**
61+
* Return toolbar block instance
62+
*
63+
* @return bool|\Magento\Framework\View\Element\Template
64+
*/
65+
public function getToolbar()
66+
{
67+
return $this->getLayout()->getBlock('page.actions.toolbar');
68+
}
69+
}

0 commit comments

Comments
 (0)