You are here

protected function CerFieldHandler::checkCardinality in Corresponding Entity References 7.3

Checks that there are enough slots in the field to add a reference.

Return value

boolean

1 call to CerFieldHandler::checkCardinality()
CerFieldHandler::validate in includes/CerFieldHandler.inc
Validates a potential reference. After doing a cardinality check, the reference is validated through the Field Attach API, allowing the module which owns the field to do its normal validation logic. If validation fails, the error(s) are logged.

File

includes/CerFieldHandler.inc, line 147
Contains CerFieldHandler.

Class

CerFieldHandler
@class Handles low-level operations for a single field on a single entity. Exposes methods to add, delete and check for references. This will also iterate over the references, returning each one as an EntityDrupalWrapper object.

Code

protected function checkCardinality() {
  return $this->field->cardinality == FIELD_CARDINALITY_UNLIMITED ? TRUE : $this->field->cardinality > $this
    ->count();
}