/** Get full user name * @param string $pattern Format of the name * @return string */ public function get_name($pattern = null) { return $pattern ? soprintf($pattern, $this) : $this->first_name . ' ' . $this->last_name; }
/** Unified name getter * @param pattern * @return string */ public function get_name($pattern = null) { if (is_null($pattern)) { return $this->has_attr('name') ? $this->name : $this->id; } else { return soprintf($pattern, $this); } }