|
@@ 1085-1092 (lines=8) @@
|
| 1082 |
|
* |
| 1083 |
|
* @since 2.0 |
| 1084 |
|
*/ |
| 1085 |
|
public static function pre_save( $type, $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
| 1086 |
|
self::field_loader( $type ); |
| 1087 |
|
|
| 1088 |
|
if ( 1 == pods_v( 'field_pre_save', $options, 1 ) && method_exists( self::$loaded[ $type ], 'pre_save' ) ) |
| 1089 |
|
$value = self::$loaded[ $type ]->pre_save( $value, $id, $name, $options, $fields, $pod, $params ); |
| 1090 |
|
|
| 1091 |
|
return $value; |
| 1092 |
|
} |
| 1093 |
|
|
| 1094 |
|
/** |
| 1095 |
|
* Save the value to the DB |
|
@@ 1110-1119 (lines=10) @@
|
| 1107 |
|
* |
| 1108 |
|
* @since 2.3 |
| 1109 |
|
*/ |
| 1110 |
|
public static function save( $type, $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
| 1111 |
|
self::field_loader( $type ); |
| 1112 |
|
|
| 1113 |
|
$saved = null; |
| 1114 |
|
|
| 1115 |
|
if ( 1 == pods_v( 'field_save', $options, 1 ) && method_exists( self::$loaded[ $type ], 'save' ) ) |
| 1116 |
|
$saved = self::$loaded[ $type ]->save( $value, $id, $name, $options, $fields, $pod, $params ); |
| 1117 |
|
|
| 1118 |
|
return $saved; |
| 1119 |
|
} |
| 1120 |
|
|
| 1121 |
|
/** |
| 1122 |
|
* Delete the value from the DB |
|
@@ 1134-1143 (lines=10) @@
|
| 1131 |
|
* |
| 1132 |
|
* @since 2.3 |
| 1133 |
|
*/ |
| 1134 |
|
public static function delete( $type, $id = null, $name = null, $options = null, $pod = null ) { |
| 1135 |
|
self::field_loader( $type ); |
| 1136 |
|
|
| 1137 |
|
$deleted = null; |
| 1138 |
|
|
| 1139 |
|
if ( 1 == pods_v( 'field_delete', $options, 1 ) && method_exists( self::$loaded[ $type ], 'delete' ) ) |
| 1140 |
|
$deleted = self::$loaded[ $type ]->delete( $id, $name, $options, $pod ); |
| 1141 |
|
|
| 1142 |
|
return $deleted; |
| 1143 |
|
} |
| 1144 |
|
|
| 1145 |
|
/** |
| 1146 |
|
* Check if a user has permission to be editing a field |