/** * @param User $user * * @return array */ public function normalizeUser(User $user) { $annotations = []; foreach ($user->getAnnotations() as $key => $annotation) { $annotations[] = ['key' => $key, 'value' => $annotation]; } return ['reference' => $user->getReference(), 'firstName' => $user->getFirstName(), 'lastName' => $user->getLastName(), 'loginName' => $user->getLoginName(), 'annotations' => $annotations]; }
/** * @inheritdoc * * @param User $other */ public function compareTo($other) { $ref1 = strtoupper($this->getReference()); $ref2 = strtoupper($other->getReference()); $c = new \Collator('en'); return $c->compare($ref1, $ref2); }