Code Duplication    Length = 2-2 lines in 6 locations

classes/PodsAPI.php 6 locations

@@ 2807-2808 (lines=2) @@
2804
        if ( false === $sanitized )
2805
            $params = pods_sanitize( $params );
2806
2807
        if ( !isset( $params->name ) || empty( $params->name ) )
2808
            return pods_error( __( 'Name must be given to save an Object', 'pods' ), $this );
2809
2810
        if ( !isset( $params->type ) || empty( $params->type ) )
2811
            return pods_error( __( 'Type must be given to save an Object', 'pods' ), $this );
@@ 2810-2811 (lines=2) @@
2807
        if ( !isset( $params->name ) || empty( $params->name ) )
2808
            return pods_error( __( 'Name must be given to save an Object', 'pods' ), $this );
2809
2810
        if ( !isset( $params->type ) || empty( $params->type ) )
2811
            return pods_error( __( 'Type must be given to save an Object', 'pods' ), $this );
2812
2813
        $object = array(
2814
            'id' => 0,
@@ 6232-6233 (lines=2) @@
6229
        else {
6230
            $params = (object) pods_sanitize( $params );
6231
6232
            if ( !isset( $params->type ) || empty( $params->type ) )
6233
                return pods_error( __( 'Object type is required', 'pods' ), $this );
6234
6235
            if ( ( !isset( $params->id ) || empty( $params->id ) ) && ( !isset( $params->name ) || empty( $params->name ) ) )
6236
                return pods_error( __( 'Either Object ID or Name are required', 'pods' ), $this );
@@ 6295-6296 (lines=2) @@
6292
    public function load_objects ( $params ) {
6293
        $params = (object) pods_sanitize( $params );
6294
6295
        if ( !isset( $params->type ) || empty( $params->type ) )
6296
            return pods_error( __( 'Pods Object type is required', 'pods' ), $this );
6297
6298
        $order = 'ASC';
6299
        $orderby = 'menu_order';
@@ 6548-6549 (lines=2) @@
6545
    public function load_pod_item ( $params ) {
6546
        $params = (object) pods_sanitize( $params );
6547
6548
        if ( !isset( $params->pod ) || empty( $params->pod ) )
6549
            return pods_error( __( 'Pod name required', 'pods' ), $this );
6550
        if ( !isset( $params->id ) || empty( $params->id ) )
6551
            return pods_error( __( 'Item ID required', 'pods' ), $this );
6552
@@ 6550-6551 (lines=2) @@
6547
6548
        if ( !isset( $params->pod ) || empty( $params->pod ) )
6549
            return pods_error( __( 'Pod name required', 'pods' ), $this );
6550
        if ( !isset( $params->id ) || empty( $params->id ) )
6551
            return pods_error( __( 'Item ID required', 'pods' ), $this );
6552
6553
        $pod = false;
6554