daily pastebin goal
32%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. in_array on objects with circular references
  2. public function addField ($name, ifaceNode $field)
  3. {
  4.     // Prevent the same field being added multiple times
  5.     if (!in_array ($field, $this -> fields))
  6.     {
  7.         $this -> fields [$name] = $field;
  8.         $field -> setParent ($this);
  9.     }
  10.     else
  11.     {
  12.         throw new InvalidArgumentException ('This field cannot be added to this group');
  13.     }
  14.     return ($this);
  15. }
  16.    
  17. if (!in_array ($field, $this -> fields, true))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top