summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/lib/Elastica/Result.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Result.php')
-rw-r--r--vendor/ruflin/elastica/lib/Elastica/Result.php67
1 files changed, 34 insertions, 33 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Result.php b/vendor/ruflin/elastica/lib/Elastica/Result.php
index e8aa8e3d..6b3c68f2 100644
--- a/vendor/ruflin/elastica/lib/Elastica/Result.php
+++ b/vendor/ruflin/elastica/lib/Elastica/Result.php
@@ -1,27 +1,24 @@
<?php
-
namespace Elastica;
/**
- * Elastica result item
+ * Elastica result item.
*
* Stores all information from a result
*
- * @category Xodoa
- * @package Elastica
* @author Nicolas Ruflin <spam@ruflin.com>
*/
class Result
{
/**
- * Hit array
+ * Hit array.
*
* @var array Hit array
*/
protected $_hit = array();
/**
- * Constructs a single results object
+ * Constructs a single results object.
*
* @param array $hit Hit data
*/
@@ -31,14 +28,15 @@ class Result
}
/**
- * Returns a param from the result hit array
+ * Returns a param from the result hit array.
*
* This function can be used to retrieve all data for which a specific
* function doesn't exist.
* If the param does not exist, an empty array is returned
*
- * @param string $name Param name
- * @return array Result data
+ * @param string $name Param name
+ *
+ * @return array Result data
*/
public function getParam($name)
{
@@ -50,18 +48,19 @@ class Result
}
/**
- * Test if a param from the result hit is set
+ * Test if a param from the result hit is set.
+ *
+ * @param string $name Param name to test
*
- * @param string $name Param name to test
- * @return boolean True if the param is set, false otherwise
+ * @return bool True if the param is set, false otherwise
*/
public function hasParam($name)
{
return isset($this->_hit[$name]);
- }
-
+ }
+
/**
- * Returns the hit id
+ * Returns the hit id.
*
* @return string Hit id
*/
@@ -71,7 +70,7 @@ class Result
}
/**
- * Returns the type of the result
+ * Returns the type of the result.
*
* @return string Result type
*/
@@ -81,7 +80,7 @@ class Result
}
/**
- * Returns list of fields
+ * Returns list of fields.
*
* @return array Fields list
*/
@@ -91,17 +90,17 @@ class Result
}
/**
- * Returns whether result has fields
- *
+ * Returns whether result has fields.
+ *
* @return bool
*/
public function hasFields()
{
return $this->hasParam('fields');
- }
-
+ }
+
/**
- * Returns the index name of the result
+ * Returns the index name of the result.
*
* @return string Index name
*/
@@ -111,7 +110,7 @@ class Result
}
/**
- * Returns the score of the result
+ * Returns the score of the result.
*
* @return float Result score
*/
@@ -121,7 +120,7 @@ class Result
}
/**
- * Returns the raw hit array
+ * Returns the raw hit array.
*
* @return array Hit array
*/
@@ -131,7 +130,7 @@ class Result
}
/**
- * Returns the version information from the hit
+ * Returns the version information from the hit.
*
* @return string|int Document version
*/
@@ -141,7 +140,7 @@ class Result
}
/**
- * Returns result data
+ * Returns result data.
*
* Checks for partial result data with getFields, falls back to getSource
*
@@ -157,7 +156,7 @@ class Result
}
/**
- * Returns the result source
+ * Returns the result source.
*
* @return array Source data array
*/
@@ -167,7 +166,7 @@ class Result
}
/**
- * Returns result data
+ * Returns result data.
*
* @return array Result data array
*/
@@ -187,12 +186,13 @@ class Result
}
/**
- * Magic function to directly access keys inside the result
+ * Magic function to directly access keys inside the result.
*
* Returns null if key does not exist
*
- * @param string $key Key name
- * @return mixed Key value
+ * @param string $key Key name
+ *
+ * @return mixed Key value
*/
public function __get($key)
{
@@ -200,11 +200,12 @@ class Result
return array_key_exists($key, $source) ? $source[$key] : null;
}
-
+
/**
- * Magic function to support isset() calls
+ * Magic function to support isset() calls.
*
* @param string $key Key name
+ *
* @return bool
*/
public function __isset($key)