Code Duplication    Length = 2-2 lines in 6 locations

classes/PodsAPI.php 6 locations

@@ 2828-2829 (lines=2) @@
2825
        if ( false === $sanitized )
2826
            $params = pods_sanitize( $params );
2827
2828
        if ( !isset( $params->name ) || empty( $params->name ) )
2829
            return pods_error( __( 'Name must be given to save an Object', 'pods' ), $this );
2830
2831
        if ( !isset( $params->type ) || empty( $params->type ) )
2832
            return pods_error( __( 'Type must be given to save an Object', 'pods' ), $this );
@@ 2831-2832 (lines=2) @@
2828
        if ( !isset( $params->name ) || empty( $params->name ) )
2829
            return pods_error( __( 'Name must be given to save an Object', 'pods' ), $this );
2830
2831
        if ( !isset( $params->type ) || empty( $params->type ) )
2832
            return pods_error( __( 'Type must be given to save an Object', 'pods' ), $this );
2833
2834
        $object = array(
2835
            'id' => 0,
@@ 6548-6549 (lines=2) @@
6545
        else {
6546
            $params = (object) pods_sanitize( $params );
6547
6548
            if ( !isset( $params->type ) || empty( $params->type ) )
6549
                return pods_error( __( 'Object type is required', 'pods' ), $this );
6550
6551
            if ( ( !isset( $params->id ) || empty( $params->id ) ) && ( !isset( $params->name ) || empty( $params->name ) ) )
6552
                return pods_error( __( 'Either Object ID or Name are required', 'pods' ), $this );
@@ 6611-6612 (lines=2) @@
6608
    public function load_objects ( $params ) {
6609
        $params = (object) pods_sanitize( $params );
6610
6611
        if ( !isset( $params->type ) || empty( $params->type ) )
6612
            return pods_error( __( 'Pods Object type is required', 'pods' ), $this );
6613
6614
        $order = 'ASC';
6615
        $orderby = 'menu_order';
@@ 6864-6865 (lines=2) @@
6861
    public function load_pod_item ( $params ) {
6862
        $params = (object) pods_sanitize( $params );
6863
6864
        if ( !isset( $params->pod ) || empty( $params->pod ) )
6865
            return pods_error( __( 'Pod name required', 'pods' ), $this );
6866
        if ( !isset( $params->id ) || empty( $params->id ) )
6867
            return pods_error( __( 'Item ID required', 'pods' ), $this );
6868
@@ 6866-6867 (lines=2) @@
6863
6864
        if ( !isset( $params->pod ) || empty( $params->pod ) )
6865
            return pods_error( __( 'Pod name required', 'pods' ), $this );
6866
        if ( !isset( $params->id ) || empty( $params->id ) )
6867
            return pods_error( __( 'Item ID required', 'pods' ), $this );
6868
6869
        $pod = false;
6870