Back to ApplicationHelper class

Method addClientInfo

public static bool
addClientInfo
(mixed $client)
Adds information for a client.
Parameters
  • mixed $client A client identifier either an array or object
Returns
  • bool True if the information is added. False on error
Since
  • 1.6

Method addClientInfo - Source code

/**
 * Adds information for a client.
 *
 * @param   mixed  $client  A client identifier either an array or object
 *
 * @return  boolean  True if the information is added. False on error
 *
 * @since   1.6
 */
public static function addClientInfo($client)
{
    if (\is_array($client)) {
        $client = (object) $client;
    }
    if (!\is_object($client)) {
        return false;
    }
    $info = self::getClientInfo();
    if (!isset($client->id)) {
        $client->id = \count($info);
    }
    self::$_clients[$client->id] = clone $client;
    return true;
}