Code Duplication    Length = 16-16 lines in 2 locations

classes/fields/pick.php 2 locations

@@ 605-620 (lines=16) @@
602
     * @return array Simple object names
603
     * @since 2.3
604
     */
605
    public function simple_objects () {
606
		if ( $this->setup_related_objects() || null === self::$names_simple ) {
607
			$simple_objects = array();
608
609
			foreach ( self::$related_objects as $object => $related_object ) {
610
				if ( !isset( $related_object[ 'simple' ] ) || !$related_object[ 'simple' ] )
611
					continue;
612
613
				$simple_objects[] = $object;
614
			}
615
616
			self::$names_simple = (array) apply_filters( 'pods_form_ui_field_pick_simple_objects', $simple_objects );
617
		}
618
619
	    return self::$names_simple;
620
    }
621
622
    /**
623
     * Return available bidirectional object names
@@ 628-643 (lines=16) @@
625
     * @return array Bidirectional object names
626
     * @since 2.3.4
627
     */
628
    public function bidirectional_objects () {
629
        if ( $this->setup_related_objects() || null === self::$names_bidirectional ) {
630
	        $bidirectional_objects = array();
631
632
	        foreach ( self::$related_objects as $object => $related_object ) {
633
		        if ( !isset( $related_object[ 'bidirectional' ] ) || !$related_object[ 'bidirectional' ] )
634
			        continue;
635
636
		        $bidirectional_objects[] = $object;
637
	        }
638
639
	        self::$names_bidirectional = (array) apply_filters( 'pods_form_ui_field_pick_bidirectional_objects', $bidirectional_objects );
640
        }
641
642
	    return self::$names_bidirectional;
643
    }
644
645
    /**
646
     * Define the current field's schema for DB table storage