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,
@@ 6490-6491 (lines=2) @@
6487
        else {
6488
            $params = (object) pods_sanitize( $params );
6489
6490
            if ( !isset( $params->type ) || empty( $params->type ) )
6491
                return pods_error( __( 'Object type is required', 'pods' ), $this );
6492
6493
            if ( ( !isset( $params->id ) || empty( $params->id ) ) && ( !isset( $params->name ) || empty( $params->name ) ) )
6494
                return pods_error( __( 'Either Object ID or Name are required', 'pods' ), $this );
@@ 6553-6554 (lines=2) @@
6550
    public function load_objects ( $params ) {
6551
        $params = (object) pods_sanitize( $params );
6552
6553
        if ( !isset( $params->type ) || empty( $params->type ) )
6554
            return pods_error( __( 'Pods Object type is required', 'pods' ), $this );
6555
6556
        $order = 'ASC';
6557
        $orderby = 'menu_order';
@@ 6806-6807 (lines=2) @@
6803
    public function load_pod_item ( $params ) {
6804
        $params = (object) pods_sanitize( $params );
6805
6806
        if ( !isset( $params->pod ) || empty( $params->pod ) )
6807
            return pods_error( __( 'Pod name required', 'pods' ), $this );
6808
        if ( !isset( $params->id ) || empty( $params->id ) )
6809
            return pods_error( __( 'Item ID required', 'pods' ), $this );
6810
@@ 6808-6809 (lines=2) @@
6805
6806
        if ( !isset( $params->pod ) || empty( $params->pod ) )
6807
            return pods_error( __( 'Pod name required', 'pods' ), $this );
6808
        if ( !isset( $params->id ) || empty( $params->id ) )
6809
            return pods_error( __( 'Item ID required', 'pods' ), $this );
6810
6811
        $pod = false;
6812