public function CerFieldHandler::count in Corresponding Entity References 7.3
Implements Countable::count().
3 calls to CerFieldHandler::count()
- CerFieldHandler::checkCardinality in includes/
CerFieldHandler.inc - Checks that there are enough slots in the field to add a reference.
- CerFieldHandler::seek in includes/
CerFieldHandler.inc - Implements SeekableIterator::seek().
- CerFieldHandler::valid in includes/
CerFieldHandler.inc - Implements Iterator::valid().
File
- includes/
CerFieldHandler.inc, line 243 - 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
public function count() {
if ($this->isMultiValue) {
return sizeof($this->value);
}
else {
return $this->value
->value() ? 1 : 0;
}
}