get_object_type() == $side->get_object_type(); } /** * @param object Raw object or P2P_Item * @return bool|P2P_Item */ function item_recognize( $arg ) { $class = $this->item_type; if ( is_a( $arg, 'P2P_Item' ) ) { if ( !is_a( $arg, $class ) ) { return false; } $arg = $arg->get_object(); } $raw_item = $this->recognize( $arg ); if ( !$raw_item ) return false; return new $class( $raw_item ); } /** * @param object Raw object */ abstract protected function recognize( $arg ); }