Page MenuHomePhabricator

No OneTemporary

diff --git a/src/Controller/TYPProfileCatalogController.php b/src/Controller/TYPProfileCatalogController.php
new file mode 100644
--- /dev/null
+++ b/src/Controller/TYPProfileCatalogController.php
@@ -0,0 +1,40 @@
+<?php
+namespace Drupal\typ_profile\Controller;
+
+use Drupal\Core\Controller\ControllerBase;
+/**
+*
+*/
+class TYPProfileCatalogController extends ControllerBase
+{
+ static $customer;
+ public function catalogTitle($bizid){
+ if (!self::$customer){
+ self::$customer = \Drupal::service('typ.search')->getProfile($bizid, AUTO);
+ }
+ return t(self::$customer['humanname']);
+ }
+
+ public static function catalogPage($bizid){
+ global $base_path;
+ if (!self::$customer){
+ self::$customer = \Drupal::service('typ.search')->getProfile($bizid, AUTO);
+ }
+ $customer = self::$customer;
+ $options['WHAT'] = $customer['customerid'];
+ $options['FROM'] = 0;
+ $options['CATALOG_SIZE'] = 999;
+ $options['SEARCH_MODE'] = 'CUSTOMERID';
+ $result = \Drupal::service('typ.search')->searchCatalog($options);
+
+ $display[] = array(
+ '#theme' => 'typ_search_results',
+ '#resultsOnlineCatalog' => $result['_res'],
+ '#time' => $result['_time'],
+ '#total' => $result['_total'],
+ '#base_path' => $base_path
+ );
+ return $display;
+ }
+}
+?>
\ No newline at end of file

File Metadata

Mime Type
text/x-diff
Expires
Wed, Apr 30, 5:13 AM (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
213674

Event Timeline