| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * @copyright Aimeos (aimeos.org), 2018-2020 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * @package MShop | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  * @subpackage Customer | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  | namespace Aimeos\MShop\Customer\Manager\Property; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |  * Default property manager implementation. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  |  * @package MShop | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  |  * @subpackage Customer | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | class Ezpublish | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  | 	extends \Aimeos\MShop\Customer\Manager\Property\Standard | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  | 	private $searchConfig = array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  | 		'customer.property.id' => array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  | 			'code' => 'customer.property.id', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  | 			'internalcode' => 'ezppr."id"', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  | 			'label' => 'Property ID', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  | 			'type' => 'integer', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  | 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  | 			'public' => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  | 		), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  | 		'customer.property.parentid' => array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  | 			'code' => 'customer.property.parentid', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  | 			'internalcode' => 'ezppr."parentid"', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  | 			'label' => 'Property parent ID', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  | 			'type' => 'integer', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  | 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  | 			'public' => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  | 		), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  | 		'customer.property.siteid' => array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  | 			'code' => 'customer.property.siteid', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  | 			'internalcode' => 'ezppr."siteid"', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  | 			'label' => 'Property site ID', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  | 			'type' => 'string', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  | 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  | 			'public' => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  | 		), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  | 		'customer.property.type' => array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  | 			'code' => 'customer.property.type', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  | 			'internalcode' => 'ezppr."type"', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  | 			'label' => 'Property type', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  | 			'type' => 'string', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  | 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  | 		), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  | 		'customer.property.value' => array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  | 			'code' => 'customer.property.value', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  | 			'internalcode' => 'ezppr."value"', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  | 			'label' => 'Property value', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  | 			'type' => 'string', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  | 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  | 		), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  | 		'customer.property.languageid' => array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  | 			'code' => 'customer.property.languageid', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  | 			'internalcode' => 'ezppr."langid"', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  | 			'label' => 'Property language ID', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  | 			'type' => 'string', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  | 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  | 		), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  | 		'customer.property.ctime' => array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  | 			'code' => 'customer.property.ctime', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  | 			'internalcode' => 'ezppr."ctime"', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  | 			'label' => 'Property create date/time', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  | 			'type' => 'datetime', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  | 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  | 			'public' => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  | 		), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  | 		'customer.property.mtime' => array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  | 			'code' => 'customer.property.mtime', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  | 			'internalcode' => 'ezppr."mtime"', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  | 			'label' => 'Property modify date', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  | 			'type' => 'datetime', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  | 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  | 			'public' => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  | 		), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  | 		'customer.property.editor' => array( | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  | 			'code' => 'customer.property.editor', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  | 			'internalcode' => 'ezppr."editor"', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  | 			'label' => 'Property editor', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  | 			'type' => 'string', | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  | 			'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  | 			'public' => false, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 |  |  | 		), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  | 	); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  | 	 * Removes old entries from the storage. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  | 	 * @param string[] $siteids List of IDs for sites whose entries should be deleted | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  | 	 * @return \Aimeos\MShop\Common\Manager\Iface Same object for fluent interface | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  | 	public function clear( array $siteids ) : \Aimeos\MShop\Common\Manager\Iface | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  | 		$path = 'mshop/customer/manager/property/submanagers'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 |  |  | 		foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 |  |  | 			$this->getObject()->getSubManager( $domain )->clear( $siteids ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 |  |  | 		} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 |  |  | 		return $this->clearBase( $siteids, 'mshop/customer/manager/property/ezpublish/delete' ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 114 |  |  | 	 * Returns the attributes that can be used for searching. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 |  |  | 	 * @param bool $withsub Return also attributes of sub-managers if true | 
            
                                                                                                            
                            
            
                                    
            
            
                | 117 |  |  | 	 * @return array Returns a list of attribtes implementing \Aimeos\MW\Criteria\Attribute\Iface | 
            
                                                                                                            
                            
            
                                    
            
            
                | 118 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 119 |  |  | 	public function getSearchAttributes( bool $withsub = true ) : array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 120 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 121 |  |  | 		$path = 'mshop/customer/manager/property/submanagers'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 122 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 123 |  |  | 		return $this->getSearchAttributesBase( $this->searchConfig, $path, [], $withsub ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 124 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 125 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 126 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 127 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 128 |  |  | 	 * Returns a new manager for customer extensions | 
            
                                                                                                            
                            
            
                                    
            
            
                | 129 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 130 |  |  | 	 * @param string $manager Name of the sub manager type in lower case | 
            
                                                                                                            
                            
            
                                    
            
            
                | 131 |  |  | 	 * @param string|null $name Name of the implementation, will be from | 
            
                                                                                                            
                            
            
                                    
            
            
                | 132 |  |  | 	 * configuration (or Default) if null | 
            
                                                                                                            
                            
            
                                    
            
            
                | 133 |  |  | 	 * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g property types, property lists etc. | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 134 |  |  | 	 */ | 
            
                                                                        
                            
            
                                    
            
            
                | 135 |  |  | 	public function getSubManager( string $manager, string $name = null ) : \Aimeos\MShop\Common\Manager\Iface | 
            
                                                                        
                            
            
                                    
            
            
                | 136 |  |  | 	{ | 
            
                                                                        
                            
            
                                    
            
            
                | 137 |  |  | 		return $this->getSubManagerBase( 'customer', 'property/' . $manager, ( $name === null ? 'Ezpublish' : $name ) ); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 138 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 139 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 140 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 141 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 142 |  |  | 	 * Returns the config path for retrieving the configuration values. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 143 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 144 |  |  | 	 * @return string Configuration path | 
            
                                                                                                            
                            
            
                                    
            
            
                | 145 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 146 |  |  | 	protected function getConfigPath() : string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 147 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 148 |  |  | 		return 'mshop/customer/manager/property/ezpublish/'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 |  |  | 	/** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 153 |  |  | 	 * Returns the search configuration for searching items. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 154 |  |  | 	 * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 155 |  |  | 	 * @return array Associative list of search keys and search definitions | 
            
                                                                                                            
                            
            
                                    
            
            
                | 156 |  |  | 	 */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 157 |  |  | 	protected function getSearchConfig() : array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 158 |  |  | 	{ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 159 |  |  | 		return $this->searchConfig; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 160 |  |  | 	} | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 161 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 162 |  |  |  |