summaryrefslogtreecommitdiffstats
path: root/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser.php')
-rw-r--r--core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser.php b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser.php
index 19467fa..1c0acb8 100644
--- a/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser.php
+++ b/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser.php
@@ -5,7 +5,7 @@
*
* LICENSE
*
- * Copyright (c) 2009-2010 Nicholas J Humfrey. All rights reserved.
+ * Copyright (c) 2009-2013 Nicholas J Humfrey. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -31,22 +31,25 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* @package EasyRdf
- * @copyright Copyright (c) 2009-2010 Nicholas J Humfrey
+ * @copyright Copyright (c) 2009-2013 Nicholas J Humfrey
* @license http://www.opensource.org/licenses/bsd-license.php
- * @version $Id$
*/
/**
* Parent class for the EasyRdf serialiser
*
* @package EasyRdf
- * @copyright Copyright (c) 2009-2010 Nicholas J Humfrey
+ * @copyright Copyright (c) 2009-2013 Nicholas J Humfrey
* @license http://www.opensource.org/licenses/bsd-license.php
*/
class EasyRdf_Serialiser
{
protected $prefixes = array();
+ public function __construct()
+ {
+ }
+
/**
* Keep track of the prefixes used while serialising
* @ignore
@@ -63,19 +66,17 @@ class EasyRdf_Serialiser
*/
protected function checkSerialiseParams(&$graph, &$format)
{
- if ($graph == null or !is_object($graph) or
- get_class($graph) != 'EasyRdf_Graph') {
+ if (is_null($graph) or !is_object($graph) or !($graph instanceof EasyRdf_Graph)) {
throw new InvalidArgumentException(
"\$graph should be an EasyRdf_Graph object and cannot be null"
);
}
- if ($format == null or $format == '') {
+ if (is_null($format) or $format == '') {
throw new InvalidArgumentException(
"\$format cannot be null or empty"
);
- } elseif (is_object($format) and
- get_class($format) == 'EasyRdf_Format') {
+ } elseif (is_object($format) and ($format instanceof EasyRdf_Format)) {
$format = $format->getName();
} elseif (!is_string($format)) {
throw new InvalidArgumentException(
@@ -96,7 +97,7 @@ class EasyRdf_Serialiser
$count = count($properties);
if ($count == 1) {
$property = $properties[0];
- return $resource->count("^<$property>");
+ return $resource->countValues("^<$property>");
} else {
return $count;
}
@@ -106,7 +107,7 @@ class EasyRdf_Serialiser
* Sub-classes must follow this protocol
* @ignore
*/
- public function serialise($graph, $format)
+ public function serialise($graph, $format, array $options = array())
{
throw new EasyRdf_Exception(
"This method should be overridden by sub-classes."