Code Duplication    Length = 2-2 lines in 6 locations

classes/PodsAPI.php 6 locations

@@ 2816-2817 (lines=2) @@
2813
        if ( false === $sanitized )
2814
            $params = pods_sanitize( $params );
2815
2816
        if ( !isset( $params->name ) || empty( $params->name ) )
2817
            return pods_error( __( 'Name must be given to save an Object', 'pods' ), $this );
2818
2819
        if ( !isset( $params->type ) || empty( $params->type ) )
2820
            return pods_error( __( 'Type must be given to save an Object', 'pods' ), $this );
@@ 2819-2820 (lines=2) @@
2816
        if ( !isset( $params->name ) || empty( $params->name ) )
2817
            return pods_error( __( 'Name must be given to save an Object', 'pods' ), $this );
2818
2819
        if ( !isset( $params->type ) || empty( $params->type ) )
2820
            return pods_error( __( 'Type must be given to save an Object', 'pods' ), $this );
2821
2822
        $object = array(
2823
            'id' => 0,
@@ 6409-6410 (lines=2) @@
6406
        else {
6407
            $params = (object) pods_sanitize( $params );
6408
6409
            if ( !isset( $params->type ) || empty( $params->type ) )
6410
                return pods_error( __( 'Object type is required', 'pods' ), $this );
6411
6412
            if ( ( !isset( $params->id ) || empty( $params->id ) ) && ( !isset( $params->name ) || empty( $params->name ) ) )
6413
                return pods_error( __( 'Either Object ID or Name are required', 'pods' ), $this );
@@ 6472-6473 (lines=2) @@
6469
    public function load_objects ( $params ) {
6470
        $params = (object) pods_sanitize( $params );
6471
6472
        if ( !isset( $params->type ) || empty( $params->type ) )
6473
            return pods_error( __( 'Pods Object type is required', 'pods' ), $this );
6474
6475
        $order = 'ASC';
6476
        $orderby = 'menu_order';
@@ 6725-6726 (lines=2) @@
6722
    public function load_pod_item ( $params ) {
6723
        $params = (object) pods_sanitize( $params );
6724
6725
        if ( !isset( $params->pod ) || empty( $params->pod ) )
6726
            return pods_error( __( 'Pod name required', 'pods' ), $this );
6727
        if ( !isset( $params->id ) || empty( $params->id ) )
6728
            return pods_error( __( 'Item ID required', 'pods' ), $this );
6729
@@ 6727-6728 (lines=2) @@
6724
6725
        if ( !isset( $params->pod ) || empty( $params->pod ) )
6726
            return pods_error( __( 'Pod name required', 'pods' ), $this );
6727
        if ( !isset( $params->id ) || empty( $params->id ) )
6728
            return pods_error( __( 'Item ID required', 'pods' ), $this );
6729
6730
        $pod = false;
6731