Skip to content

Commit

Permalink
[#13697] - Corrected comments
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Sep 7, 2019
1 parent 38753f9 commit bd56301
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions phalcon/Validation/Validator/Uniqueness.zep
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,9 @@ class Uniqueness extends AbstractCombinedFieldsValidator
protected function isUniqueness(<Validation> validation, var field) -> bool
{
var values, convert, record, params, className, isModel, singleField;
/**
* @todo: The functionality below will be restored once the new Mongo related classes
* are introduced. The new classes will use the latest PHP driver.
*/
//
// @todo: Restore when new Collection is reintroduced
//
// var isDocument;

if typeof field != "array" {
Expand Down Expand Up @@ -175,28 +174,25 @@ class Uniqueness extends AbstractCombinedFieldsValidator
}

let isModel = record instanceof ModelInterface;
/**
* @todo: The functionality below will be restored once the new Mongo related classes
* are introduced. The new classes will use the latest PHP driver.
*/
//
// @todo: Restore when new Collection is reintroduced
//
// let isDocument = record instanceof CollectionInterface;

if isModel {
let params = this->isUniquenessModel(record, field, values);
/**
* @todo: The functionality below will be restored once the new Mongo related classes
* are introduced. The new classes will use the latest PHP driver.
*/
//
// @todo: Restore when new Collection is reintroduced
//
// } elseif isDocument {
// let params = this->isUniquenessCollection(record, field, values);
} else {
throw new Exception(
"The uniqueness validator works only with Phalcon\\Mvc\\Model"
);
/**
* @todo: The functionality below will be restored once the new Mongo related classes
* are introduced. The new classes will use the latest PHP driver.
*/
//
// @todo: Restore when new Collection is reintroduced
//
// throw new Exception(
// "The uniqueness validator works only with Phalcon\\Mvc\\Model or Phalcon\\Mvc\\Collection"
// );
Expand All @@ -208,10 +204,9 @@ class Uniqueness extends AbstractCombinedFieldsValidator
}


/**
* @todo: The functionality below will be restored once the new Mongo related classes
* are introduced. The new classes will use the latest PHP driver.
*/
//
// @todo: Restore when new Collection is reintroduced
//
// /**
// * Uniqueness method used for collection
// */
Expand Down

0 comments on commit bd56301

Please sign in to comment.