id = $id; $this->title = $title; $this->url = $url; $this->width = $width; $this->height = $height; $this->mime = $mime; } /** * Returns the definition of this class. * * @return ezcSearchDocumentDefinition */ static public function getDefinition() { $n = new ezcSearchDocumentDefinition( 'ezcSearchSimpleImage' ); $n->idProperty = 'id'; $n->fields['id'] = new ezcSearchDefinitionDocumentField( 'id', ezcSearchDocumentDefinition::TEXT ); $n->fields['title'] = new ezcSearchDefinitionDocumentField( 'title', ezcSearchDocumentDefinition::TEXT, 2, true, false, true ); $n->fields['url'] = new ezcSearchDefinitionDocumentField( 'url', ezcSearchDocumentDefinition::STRING ); $n->fields['width'] = new ezcSearchDefinitionDocumentField( 'width', ezcSearchDocumentDefinition::INT ); $n->fields['height'] = new ezcSearchDefinitionDocumentField( 'height', ezcSearchDocumentDefinition::INT ); $n->fields['mime'] = new ezcSearchDefinitionDocumentField( 'mime', ezcSearchDocumentDefinition::STRING ); return $n; } /** * Returns the state of this definition as an array. * * @return array(string=>string) */ public function getState() { return array( 'id' => $this->id, 'title' => $this->title, 'url' => $this->url, 'width' => $this->width, 'height' => $this->height, 'mime' => $this->mime, ); } /** * Sets the state of this definition. * * @param array(string=>string) $state */ public function setState( array $state ) { foreach ( $state as $key => $value ) { $this->$key = $value; } } } ?>