public function __toString() { return parent::__toString() . ' ' . $this->get('username'); }
/** * @param Record $record * @param string $relationName * @param string[] $expectedOriginalIds */ protected function assertOriginalReference(Record $record, $relationName, array $expectedOriginalIds) { $relation = $record->getTable()->getRelation($relationName); $originalReferencedIds = $relation->getOriginalReferencedIds($record, $relationName); $this->assertEquals($expectedOriginalIds, $originalReferencedIds); }
/** * @param Record $record * @param array $visited */ private function modifyRecordGraphConstraintFields(Record $record, array &$visited = array()) { $oid = $record->getOid(); if (in_array($oid, $visited)) { return; } $visited[] = $oid; $table = $record->getTable(); $relations = $table->getRelations(); foreach ($relations as $relationName => $relation) { if ($relation->hasReferenceLoadedFor($record, $relationName)) { $related = $relation->getReferenceFor($record, $relationName); if ($related instanceof RecordCollection) { foreach ($related as $relatedRecord) { $this->modifyRecordGraphConstraintFields($relatedRecord, $visited); } } else { if ($related instanceof Record) { $this->modifyRecordGraphConstraintFields($related, $visited); } } } } $idFields = $table->getIdentifierFields(); foreach ($idFields as $idField) { $record->markFieldAsModified($idField); } }
public function __toString() { return parent::__toString() . ' ' . $this->get('firstname') . ' ' . $this->get('lastname'); }