mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-11 02:36:42 +02:00
refactor: use Validation::getValidated() when using $this->validate() in controllers
This commit is contained in:
parent
ff0e681763
commit
2c07070b2c
18 changed files with 129 additions and 70 deletions
|
|
@ -650,12 +650,14 @@ class PodcastController extends BaseController
|
|||
->with('errors', $this->validator->getErrors());
|
||||
}
|
||||
|
||||
$validData = $this->validator->getValidated();
|
||||
|
||||
$db = db_connect();
|
||||
$db->transStart();
|
||||
|
||||
$publishMethod = $this->request->getPost('publication_method');
|
||||
$publishMethod = $validData['publication_method'];
|
||||
if ($publishMethod === 'schedule') {
|
||||
$scheduledPublicationDate = $this->request->getPost('scheduled_publication_date');
|
||||
$scheduledPublicationDate = $validData['scheduled_publication_date'];
|
||||
if ($scheduledPublicationDate) {
|
||||
$this->podcast->published_at = Time::createFromFormat(
|
||||
'Y-m-d H:i',
|
||||
|
|
@ -783,12 +785,14 @@ class PodcastController extends BaseController
|
|||
->with('errors', $this->validator->getErrors());
|
||||
}
|
||||
|
||||
$validData = $this->validator->getValidated();
|
||||
|
||||
$db = db_connect();
|
||||
$db->transStart();
|
||||
|
||||
$publishMethod = $this->request->getPost('publication_method');
|
||||
$publishMethod = $validData['publication_method'];
|
||||
if ($publishMethod === 'schedule') {
|
||||
$scheduledPublicationDate = $this->request->getPost('scheduled_publication_date');
|
||||
$scheduledPublicationDate = $validData['scheduled_publication_date'];
|
||||
if ($scheduledPublicationDate) {
|
||||
$this->podcast->published_at = Time::createFromFormat(
|
||||
'Y-m-d H:i',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue