set() public method

A pass-through method called by Auth. Returns the value of $data, which is written to a user's session. When implementing a custom adapter, this method may be used to modify or reject data before it is written to the session.
public set ( array $data, array $options = [] ) : array
$data array User data to be written to the session.
$options array Adapter-specific options. Not implemented in the `Form` adapter.
return array Returns the value of `$data`.
Exemplo n.º 1
0
 /**
  * Tests that `Form::set()` passes data through unmodified, even with invalid options.
  *
  * @return void
  */
 public function testSetPassthru()
 {
     $subject = new Form(array('model' => __CLASS__));
     $user = array('id' => 5, 'name' => 'bob');
     $result = $subject->set($user, null);
     $this->assertIdentical($user, $result);
 }