public function add($candidate)
    {
        $hash = $this->objectHash($candidate);

        if (isset($this->candidateIds[$hash])) {
            return $this;
        }

        $function = $this->shouldCallReversed() ? 'array_unshift' : 'array_push';

        $function($this->candidates, $this->checkAndReturn($candidate));

        $this->candidateIds[$hash] = true;

        return $this;
    }
public function add($candidate)
    {
        $hash = $this->objectHash($candidate);

        if (isset($this->candidateIds[$hash])) {
            return $this;
        }

        $function = $this->shouldCallReversed() ? 'array_unshift' : 'array_push';

        $function($this->candidates, $this->checkAndReturn($candidate));

        $this->candidateIds[$hash] = true;

        return $this;
    }
public function add ( $ candidate ) { $ hash = $ this -> objectHash ( $ candidate ) ; if ( isset ( $ this -> candidateIds [ $ hash ] ) ) { return $ this ; } $ function = $ this -> shouldCallReversed ( ) ? 'array_unshift' : 'array_push' ; $ function ( $ this -> candidates , $ this -> checkAndReturn ( $ candidate ) ) ; $ this -> candidateIds [ $ hash ] = true ; return $ this ; }
Add a candidate to the chain.

@param object $candidate

@return self
Add a candidate to the chain .