emerap / il18_config
Cache interface for integration into third-party library
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/emerap/il18_config
Requires
- php: >=5.3.0
 - symfony/yaml: 3.x
 
This package is not auto-updated.
Last update: 2025-10-26 02:14:50 UTC
README
Create class and extending from \Emerap\Il18Config.
use \Emerap\Il18Config\Il18Config;
class ClassName extends Il18Config {
  /**
     * {@inheritdoc}
     */
    public static function getLibraryId() {
      return 'library_id';
    }
  
    /**
     * {@inheritdoc}
     */
    public static function getServicesJson() {
      return __DIR__ . '/services.yml';
    }
  
    /**
     * Get cache instance.
     *
     * @return Service
     *   Service instance.
     */
    public function cache() {
      return self::getService('service_id');
    }
} 
Create class implement \Emerap\Il18Config\Il18ConfigInterface and use trait \Emerap\Il18Config\Il18ConfigTrait.
use Emerap\Il18Config\Il18ConfigInterface;
use Emerap\Il18Config\Il18ConfigTrait;
class ClassName implements Il18ConfigInterface {
  use Il18ConfigTrait;
  
  /**
     * {@inheritdoc}
     */
    public static function getLibraryId() {
      return 'library_id';
    }
  
    /**
     * {@inheritdoc}
     */
    public static function getServicesJson() {
      return __DIR__ . '/services.yml';
    }
  
    /**
     * Get cache instance.
     *
     * @return Service
     *   Service instance.
     */
    public function cache() {
      return self::getService('service_id');
    }
} 
Copyright © 2016 [ Pokhodyun Alexander]