1
<?php
2

3
/*
4
 * This file is part of the Solarium package.
5
 *
6
 * For the full copyright and license information, please view the COPYING
7
 * file that was distributed with this source code.
8
 */
9

10
namespace Solarium\Core\Plugin;
11

12
use Solarium\Core\Client\ClientInterface;
13
use Solarium\Core\Configurable;
14

15
/**
16
 * Base class for plugins.
17
 */
18
abstract class AbstractPlugin extends Configurable implements PluginInterface
19
{
20
    /**
21
     * Client instance.
22
     *
23
     * @var ClientInterface
24
     */
25
    protected $client;
26

27
    /**
28
     * Initialize.
29
     *
30
     * This method is called when the plugin is registered to a client instance
31
     *
32
     * @param ClientInterface $client
33
     * @param array           $options
34
     */
35 12
    public function initPlugin(ClientInterface $client, array $options)
36
    {
37 12
        $this->client = $client;
38 12
        parent::__construct($options);
39

40 12
        $this->initPluginType();
41
    }
42

43
    /**
44
     * Plugin init function.
45
     *
46
     * This is an extension point for plugin implementations.
47
     * Will be called as soon as $this->client and options have been set.
48
     */
49 12
    protected function initPluginType()
50
    {
51
    }
52
}

Read our documentation on viewing source code .

Loading