Code Duplication    Length = 2-2 lines in 6 locations

classes/PodsAPI.php 6 locations

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