|
|
@@ -1,7 +1,7 @@
|
|
|
<?php
|
|
|
-//require_once 'Thinkopen/Mongodb/Mongo/Exception.php';
|
|
|
-//require_once 'Thinkopen/Mongodb/Mongo/Collection.php';
|
|
|
-//require_once 'Thinkopen/Mongodb/Mongo/Iterator/Default.php';
|
|
|
+////require_once 'Thinkopen/Mongodb/Mongo/Exception.php';
|
|
|
+////require_once 'Thinkopen/Mongodb/Mongo/Collection.php';
|
|
|
+////require_once 'Thinkopen/Mongodb/Mongo/Iterator/Default.php';
|
|
|
|
|
|
/**
|
|
|
* @category Thinkopen
|
|
|
@@ -685,7 +685,7 @@ class Mooses_Mongodb_Mongo_Document extends Mooses_Mongodb_Mongo_Collection impl
|
|
|
|
|
|
// Throw exception if value is not valid
|
|
|
if (!is_null($value) && !$validators->isValid($value)) {
|
|
|
- require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
+ //require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
throw new Mooses_Mongodb_Mongo_Exception(implode($validators->getMessages(), "\n"));
|
|
|
}
|
|
|
|
|
|
@@ -775,12 +775,12 @@ class Mooses_Mongodb_Mongo_Document extends Mooses_Mongodb_Mongo_Collection impl
|
|
|
public function createReference()
|
|
|
{
|
|
|
if (!$this->isRootDocument()) {
|
|
|
- require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
+ //require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
throw new Mooses_Mongodb_Mongo_Exception('Can not create reference. Document is not a root document');
|
|
|
}
|
|
|
|
|
|
if (!$this->isConnected()) {
|
|
|
- require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
+ //require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
throw new Mooses_Mongodb_Mongo_Exception('Can not create reference. Document does not connected to a db and collection');
|
|
|
}
|
|
|
|
|
|
@@ -856,7 +856,7 @@ class Mooses_Mongodb_Mongo_Document extends Mooses_Mongodb_Mongo_Collection impl
|
|
|
$requiredProperties = $this->getPropertiesWithRequirement('Required');
|
|
|
foreach ($requiredProperties as $property) {
|
|
|
if (!isset($exportData[$property]) || (is_array($exportData[$property]) && empty($exportData[$property]))) {
|
|
|
- require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
+ //require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
throw new Mooses_Mongodb_Mongo_Exception("Property '{$property}' must not be null.");
|
|
|
}
|
|
|
}
|
|
|
@@ -977,12 +977,12 @@ class Mooses_Mongodb_Mongo_Document extends Mooses_Mongodb_Mongo_Collection impl
|
|
|
public function save($entierDocument = false, $safe = true)
|
|
|
{
|
|
|
if (!$this->isConnected()) {
|
|
|
- require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
+ //require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
throw new Mooses_Mongodb_Mongo_Exception('Can not save documet. Document is not connected to a db and collection');
|
|
|
}
|
|
|
|
|
|
if ($this->isLocked()) {
|
|
|
- require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
+ //require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
throw new Mooses_Mongodb_Mongo_Exception('Can not save documet. Document is locked.');
|
|
|
}
|
|
|
|
|
|
@@ -1090,12 +1090,12 @@ class Mooses_Mongodb_Mongo_Document extends Mooses_Mongodb_Mongo_Collection impl
|
|
|
public function delete($safe = true)
|
|
|
{
|
|
|
if (!$this->isConnected()) {
|
|
|
- require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
+ //require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
throw new Mooses_Mongodb_Mongo_Exception('Can not delete document. Document is not connected to a db and collection');
|
|
|
}
|
|
|
|
|
|
if ($this->isLocked()) {
|
|
|
- require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
+ //require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
throw new Mooses_Mongodb_Mongo_Exception('Can not save documet. Document is locked.');
|
|
|
}
|
|
|
|
|
|
@@ -1272,7 +1272,7 @@ class Mooses_Mongodb_Mongo_Document extends Mooses_Mongodb_Mongo_Collection impl
|
|
|
{
|
|
|
// Make sure the operation is valid
|
|
|
if (!Mooses_Mongodb_Mongo::isValidOperation($operation)) {
|
|
|
- require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
+ //require_once 'Thinkopen/Mongdb/Mongo/Exception.php';
|
|
|
throw new Mooses_Mongodb_Mongo_Exception("'{$operation}' is not valid operation");
|
|
|
}
|
|
|
|