2323use Drupal \Component \Datetime \TimeInterface ;
2424use Drupal \Core \Cache \CacheBackendInterface ;
2525use Drupal \Core \Cache \MemoryCache \MemoryCacheInterface ;
26+ use Drupal \Core \Config \ConfigFactoryInterface ;
2627use Drupal \Core \Entity \EntityTypeInterface ;
2728use Drupal \apigee_edge \Entity \AppInterface ;
2829use Drupal \apigee_edge \Entity \Controller \AppControllerInterface ;
@@ -72,11 +73,21 @@ class TeamAppStorage extends AppStorage implements TeamAppStorageInterface {
7273 * The app controller service.
7374 * @param \Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface $org_controller
7475 * The organization controller service.
76+ * @param \Drupal\Core\Config\ConfigFactoryInterface $config
77+ * Configuration factory.
7578 */
76- public function __construct (EntityTypeInterface $ entity_type , CacheBackendInterface $ cache_backend , MemoryCacheInterface $ memory_cache , TimeInterface $ system_time , TeamAppControllerFactoryInterface $ team_app_controller_factory , AppControllerInterface $ app_controller , OrganizationControllerInterface $ org_controller ) {
79+ public function __construct (EntityTypeInterface $ entity_type , CacheBackendInterface $ cache_backend , MemoryCacheInterface $ memory_cache , TimeInterface $ system_time , TeamAppControllerFactoryInterface $ team_app_controller_factory , AppControllerInterface $ app_controller , OrganizationControllerInterface $ org_controller, protected ? ConfigFactoryInterface $ config = NULL ) {
7780 parent ::__construct ($ entity_type , $ cache_backend , $ memory_cache , $ system_time , $ app_controller );
7881 $ this ->teamAppControllerFactory = $ team_app_controller_factory ;
7982 $ this ->orgController = $ org_controller ;
83+ if ($ config === NULL ) {
84+ @trigger_error ('Calling ' . __METHOD__ . ' without the $config is deprecated in apigee_edge:3.0.12 and it will be required in apigee_edge:3.1.0. See https://github.com/apigee/apigee-edge-drupal/pull/1155. ' , E_USER_DEPRECATED );
85+ $ config = \Drupal::configFactory ();
86+ }
87+
88+ $ config = $ config ->get ('apigee_edge_teams.team_app_settings ' );
89+ $ this ->cacheExpiration = $ config ->get ('cache_expiration ' );
90+ $ this ->cacheInsertChunkSize = $ config ->get ('cache_insert_chunk_size ' ) ?? static ::DEFAULT_PERSISTENT_CACHE_INSERT_CHUNK_SIZE ;
8091 }
8192
8293 /**
@@ -90,7 +101,8 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
90101 $ container ->get ('datetime.time ' ),
91102 $ container ->get ('apigee_edge_teams.controller.team_app_controller_factory ' ),
92103 $ container ->get ('apigee_edge.controller.app ' ),
93- $ container ->get ('apigee_edge.controller.organization ' )
104+ $ container ->get ('apigee_edge.controller.organization ' ),
105+ $ container ->get ('config.factory ' ),
94106 );
95107 }
96108
0 commit comments