Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.4] Inspection clean ups #6968

Merged
merged 3 commits into from
Sep 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Legacy/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Bolt\Helpers\Html;
use Bolt\Helpers\Str;
use Bolt\Pager;
use Bolt\Storage\Entity\FieldValue;
use Bolt\Storage\Field\Collection\RepeatingFieldCollection;
use Bolt\Translation\Translator as Trans;
use Doctrine\DBAL\Connection as DoctrineConn;
Expand Down Expand Up @@ -2414,7 +2415,6 @@ protected function getRelation($content)

public function getRepeaters($content)
{

$ids = Arr::column($content, 'id');

if (empty($ids)) {
Expand All @@ -2426,7 +2426,7 @@ public function getRepeaters($content)
// Try with the key first, if this isn't available then fall back to using the slug
$contenttypeslug = (isset($first->contenttype['key'])) ? $first->contenttype['key'] : $first->contenttype['slug'] ;
$contenttype = $this->getContentType($contenttypeslug);
$repo = $this->app['storage']->getRepository('Bolt\Storage\Entity\FieldValue');
$repo = $this->app['storage']->getRepository(FieldValue::class);

foreach ($ids as $id) {
foreach ($contenttype['fields'] as $fieldkey => $field) {
Expand Down
2 changes: 1 addition & 1 deletion src/Nut/DatabaseImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

// See if we're going to continue
if ($this->checkContinue($input, $output) === false) {
if ($this->checkContinue($input) === false) {
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Provider/PrefillServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function register(Application $app)

$app['prefill'] = $app->share(
function ($app) {
return new Prefill\ApiClient($app['guzzle.client'], $app['prefill.api_url']);
return new Prefill\ApiClient($app['guzzle.client']);
}
);

Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Field/Collection/FieldCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function serialize()
$this->initialize();

foreach ($this->collection as $field) {
$output[$field->getFieldname()] = $field->getValue();
$output[$field->getFieldName()] = $field->getValue();
}

return $output;
Expand Down
8 changes: 5 additions & 3 deletions src/Storage/Migration/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

namespace Bolt\Storage\Migration;

use Bolt\Storage\Repository;
use Bolt\Collection\Arr;
use Bolt\Storage\Entity\Relations;
use Bolt\Storage\Field\Type\RelationType;
use Bolt\Storage\Repository;

/**
* Database records import class.
Expand Down Expand Up @@ -211,7 +213,7 @@ protected function insertRecord($filename, $contenttypeslug, array $values)
$record->setValues($values);

foreach ($repo->getClassMetadata()->getFieldMappings() as $field) {
if (is_a($field['fieldtype'], 'Bolt\Storage\Field\Type\RelationType', true)) {
if (is_a($field['fieldtype'], RelationType::class, true)) {
if (count($values[$field['fieldname']])) {
$this->relationQueue[$contenttypeslug . '/' . $values['slug']] = array_merge(
(array) $this->relationQueue[$contenttypeslug][$values['slug']],
Expand Down Expand Up @@ -265,7 +267,7 @@ protected function processRelationQueue()
$relation = $this->app['query']->getContent($linkKey);
$relations[(string)$relation->getContentType()][] = $relation->getId();
}
$related = $this->app['storage']->createCollection('Bolt\Storage\Entity\Relations');
$related = $this->app['storage']->createCollection(Relations::class);
$related->setFromPost($relations, $entity);
$entity->setRelation($related);
$this->app['storage']->save($entity);
Expand Down