Skip to content

Commit

Permalink
generate import service
Browse files Browse the repository at this point in the history
  • Loading branch information
emarchak committed Apr 15, 2016
1 parent 814bee4 commit 3c88151
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fastpaced_videos.services.yml
@@ -0,0 +1,5 @@
services:
fastpaced_videos.import:
class: Drupal\fastpaced_videos\ImportService
arguments: ["@http_client", "@entity.query", "@entity_type.manager", "@config.factory", "@serialization.json"]

68 changes: 68 additions & 0 deletions src/ImportService.php
@@ -0,0 +1,68 @@
<?php

/**
* @file
* Contains \Drupal\fastpaced_videos\ImportService.
*/

namespace Drupal\fastpaced_videos;

use GuzzleHttp\Client;
use Drupal\Core\Entity\Query\QueryFactory;
use Drupal\Core\Entity\EntityTypeManager;
use Drupal\Core\Config\ConfigFactory;
use Drupal\Component\Serialization\Json;

/**
* Class ImportService.
*
* @package Drupal\fastpaced_videos
*/
class ImportService {

/**
* GuzzleHttp\Client definition.
*
* @var GuzzleHttp\Client
*/
protected $http_client;

/**
* Drupal\Core\Entity\Query\QueryFactory definition.
*
* @var Drupal\Core\Entity\Query\QueryFactory
*/
protected $entity_query;

/**
* Drupal\Core\Entity\EntityTypeManager definition.
*
* @var Drupal\Core\Entity\EntityTypeManager
*/
protected $entity_type_manager;

/**
* Drupal\Core\Config\ConfigFactory definition.
*
* @var Drupal\Core\Config\ConfigFactory
*/
protected $config_factory;

/**
* Drupal\Component\Serialization\Json definition.
*
* @var Drupal\Component\Serialization\Json
*/
protected $serialization_json;
/**
* Constructor.
*/
public function __construct(Client $http_client, QueryFactory $entity_query, EntityTypeManager $entity_type_manager, ConfigFactory $config_factory, Json $serialization_json) {
$this->http_client = $http_client;
$this->entity_query = $entity_query;
$this->entity_type_manager = $entity_type_manager;
$this->config_factory = $config_factory;
$this->serialization_json = $serialization_json;
}

}

0 comments on commit 3c88151

Please sign in to comment.