1 | <?php |
||
11 | class SolrRequest extends QueryString |
||
12 | { |
||
13 | /** |
||
14 | * @var string|null |
||
15 | */ |
||
16 | protected $handlerName = null; |
||
17 | |||
18 | /** |
||
19 | * $var string |
||
20 | */ |
||
21 | protected $responseClass = '\PSolr\Response\Response'; |
||
22 | |||
23 | /** |
||
24 | * @param array $params |
||
25 | */ |
||
26 | public function __construct(array $params = array()) |
||
31 | |||
32 | /** |
||
33 | * @param array $params |
||
34 | * |
||
35 | * @return \PSolr\Request\SolrRequest |
||
36 | */ |
||
37 | static public function factory(array $params = array()) |
||
41 | |||
42 | /** |
||
43 | * Initialization hook. Useful for setting default params. |
||
44 | */ |
||
45 | public function init() {} |
||
46 | |||
47 | /** |
||
48 | * {@inheritDoc} |
||
49 | * |
||
50 | * Converts booleans to strings. |
||
51 | */ |
||
52 | public function set($key, $value) |
||
60 | |||
61 | /** |
||
62 | * @param string $handlerName |
||
63 | * |
||
64 | * @return \PSolr\Request\SolrRequest |
||
65 | */ |
||
66 | public function setHandlerName($handlerName) |
||
71 | |||
72 | /** |
||
73 | * @return string |
||
74 | */ |
||
75 | public function getHandlerName() |
||
79 | |||
80 | /** |
||
81 | * Renders the body, most often overridden by request objects that generate |
||
82 | * JSON or XML, e.g. update requests. |
||
83 | * |
||
84 | * @return string|null |
||
85 | */ |
||
86 | public function renderBody() |
||
90 | |||
91 | /** |
||
92 | * Escape a value for use in XML. |
||
93 | * |
||
94 | * @param string $value |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | public static function escapeXml($value) |
||
102 | |||
103 | /** |
||
104 | * Replace control (non-printable) characters from string that are invalid |
||
105 | * to Solr's XML parser with a space. |
||
106 | * |
||
107 | * @param string $rawXml |
||
108 | * |
||
109 | * @return string |
||
110 | * |
||
111 | * @see http://drupalcode.org/project/apachesolr.git/blob/1dc510227f5077ccbc047be13dcf0de3120b100c:/Apache_Solr_Document.php#l399 |
||
112 | */ |
||
113 | public static function stripCtrlChars($rawXml) |
||
119 | |||
120 | /** |
||
121 | * @param \Psolr\Component\ComponentInterface $component |
||
122 | * |
||
123 | * @return \PSolr\Request\SolrRequest |
||
124 | */ |
||
125 | public function addComponent(ComponentInterface $component) |
||
130 | |||
131 | /** |
||
132 | * @param \PSolr\Request\SolrClient $solr |
||
133 | * @param array|null $headers |
||
134 | * @param array $options |
||
135 | * |
||
136 | * @return \PSolr\Response\Response|\SimpleXMLElement |
||
137 | * |
||
138 | * @throws \UnexpectedValueException |
||
139 | */ |
||
140 | public function sendRequest(SolrClient $solr, $headers = null, array $options = array()) |
||
154 | } |
||
155 |