File indexing completed on 2024-06-23 05:51:18
0001 <?php 0002 0003 /** 0004 * ocs-webserver 0005 * 0006 * Copyright 2016 by pling GmbH. 0007 * 0008 * This file is part of ocs-webserver. 0009 * 0010 * This program is free software: you can redistribute it and/or modify 0011 * it under the terms of the GNU Affero General Public License as 0012 * published by the Free Software Foundation, either version 3 of the 0013 * License, or (at your option) any later version. 0014 * 0015 * This program is distributed in the hope that it will be useful, 0016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0018 * GNU Affero General Public License for more details. 0019 * 0020 * You should have received a copy of the GNU Affero General Public License 0021 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0022 **/ 0023 class Backend_Commands_CreateStoreIndex implements Local_Queue_CommandInterface 0024 { 0025 0026 protected $storeId; 0027 protected $indexId; 0028 0029 /** 0030 * PHP 5 allows developers to declare constructor methods for classes. 0031 * Classes which have a constructor method call this method on each newly-created object, 0032 * so it is suitable for any initialization that the object may need before it is used. 0033 * 0034 * Note: Parent constructors are not called implicitly if the child class defines a constructor. 0035 * In order to run a parent constructor, a call to parent::__construct() within the child constructor is required. 0036 * 0037 * param [ mixed $args [, $... ]] 0038 * 0039 * @param int $storeId 0040 * @param string $indexId 0041 * 0042 * @link http://php.net/manual/en/language.oop5.decon.php 0043 */ 0044 public function __construct($storeId, $indexId) 0045 { 0046 $this->storeId = $storeId; 0047 $this->indexId = $indexId; 0048 } 0049 0050 public function doCommand() 0051 { 0052 return $this->callCreateIndex($this->storeId, $this->indexId); 0053 } 0054 0055 protected function callCreateIndex($storeId, $indexId) 0056 { 0057 $searchEngine = new Default_Model_Search_Lucene(Zend_Registry::get('config')->settings->search); 0058 0059 $searchEngine->createStoreSearchIndex($storeId, $indexId); 0060 } 0061 0062 }