Code Duplication    Length = 2-2 lines in 6 locations

classes/PodsAPI.php 6 locations

@@ 2802-2803 (lines=2) @@
2799
        if ( false === $sanitized )
2800
            $params = pods_sanitize( $params );
2801
2802
        if ( !isset( $params->name ) || empty( $params->name ) )
2803
            return pods_error( __( 'Name must be given to save an Object', 'pods' ), $this );
2804
2805
        if ( !isset( $params->type ) || empty( $params->type ) )
2806
            return pods_error( __( 'Type must be given to save an Object', 'pods' ), $this );
@@ 2805-2806 (lines=2) @@
2802
        if ( !isset( $params->name ) || empty( $params->name ) )
2803
            return pods_error( __( 'Name must be given to save an Object', 'pods' ), $this );
2804
2805
        if ( !isset( $params->type ) || empty( $params->type ) )
2806
            return pods_error( __( 'Type must be given to save an Object', 'pods' ), $this );
2807
2808
        $object = array(
2809
            'id' => 0,
@@ 6227-6228 (lines=2) @@
6224
        else {
6225
            $params = (object) pods_sanitize( $params );
6226
6227
            if ( !isset( $params->type ) || empty( $params->type ) )
6228
                return pods_error( __( 'Object type is required', 'pods' ), $this );
6229
6230
            if ( ( !isset( $params->id ) || empty( $params->id ) ) && ( !isset( $params->name ) || empty( $params->name ) ) )
6231
                return pods_error( __( 'Either Object ID or Name are required', 'pods' ), $this );
@@ 6290-6291 (lines=2) @@
6287
    public function load_objects ( $params ) {
6288
        $params = (object) pods_sanitize( $params );
6289
6290
        if ( !isset( $params->type ) || empty( $params->type ) )
6291
            return pods_error( __( 'Pods Object type is required', 'pods' ), $this );
6292
6293
        $order = 'ASC';
6294
        $orderby = 'menu_order';
@@ 6543-6544 (lines=2) @@
6540
    public function load_pod_item ( $params ) {
6541
        $params = (object) pods_sanitize( $params );
6542
6543
        if ( !isset( $params->pod ) || empty( $params->pod ) )
6544
            return pods_error( __( 'Pod name required', 'pods' ), $this );
6545
        if ( !isset( $params->id ) || empty( $params->id ) )
6546
            return pods_error( __( 'Item ID required', 'pods' ), $this );
6547
@@ 6545-6546 (lines=2) @@
6542
6543
        if ( !isset( $params->pod ) || empty( $params->pod ) )
6544
            return pods_error( __( 'Pod name required', 'pods' ), $this );
6545
        if ( !isset( $params->id ) || empty( $params->id ) )
6546
            return pods_error( __( 'Item ID required', 'pods' ), $this );
6547
6548
        $pod = false;
6549