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,
@@ 6415-6416 (lines=2) @@
6412
        else {
6413
            $params = (object) pods_sanitize( $params );
6414
6415
            if ( !isset( $params->type ) || empty( $params->type ) )
6416
                return pods_error( __( 'Object type is required', 'pods' ), $this );
6417
6418
            if ( ( !isset( $params->id ) || empty( $params->id ) ) && ( !isset( $params->name ) || empty( $params->name ) ) )
6419
                return pods_error( __( 'Either Object ID or Name are required', 'pods' ), $this );
@@ 6478-6479 (lines=2) @@
6475
    public function load_objects ( $params ) {
6476
        $params = (object) pods_sanitize( $params );
6477
6478
        if ( !isset( $params->type ) || empty( $params->type ) )
6479
            return pods_error( __( 'Pods Object type is required', 'pods' ), $this );
6480
6481
        $order = 'ASC';
6482
        $orderby = 'menu_order';
@@ 6731-6732 (lines=2) @@
6728
    public function load_pod_item ( $params ) {
6729
        $params = (object) pods_sanitize( $params );
6730
6731
        if ( !isset( $params->pod ) || empty( $params->pod ) )
6732
            return pods_error( __( 'Pod name required', 'pods' ), $this );
6733
        if ( !isset( $params->id ) || empty( $params->id ) )
6734
            return pods_error( __( 'Item ID required', 'pods' ), $this );
6735
@@ 6733-6734 (lines=2) @@
6730
6731
        if ( !isset( $params->pod ) || empty( $params->pod ) )
6732
            return pods_error( __( 'Pod name required', 'pods' ), $this );
6733
        if ( !isset( $params->id ) || empty( $params->id ) )
6734
            return pods_error( __( 'Item ID required', 'pods' ), $this );
6735
6736
        $pod = false;
6737