|
@@ 1064-1071 (lines=8) @@
|
| 1061 |
|
* |
| 1062 |
|
* @since 2.0 |
| 1063 |
|
*/ |
| 1064 |
|
public static function pre_save( $type, $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
| 1065 |
|
self::field_loader( $type ); |
| 1066 |
|
|
| 1067 |
|
if ( 1 == pods_v( 'field_pre_save', $options, 1 ) && method_exists( self::$loaded[ $type ], 'pre_save' ) ) |
| 1068 |
|
$value = self::$loaded[ $type ]->pre_save( $value, $id, $name, $options, $fields, $pod, $params ); |
| 1069 |
|
|
| 1070 |
|
return $value; |
| 1071 |
|
} |
| 1072 |
|
|
| 1073 |
|
/** |
| 1074 |
|
* Save the value to the DB |
|
@@ 1089-1098 (lines=10) @@
|
| 1086 |
|
* |
| 1087 |
|
* @since 2.3 |
| 1088 |
|
*/ |
| 1089 |
|
public static function save( $type, $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
| 1090 |
|
self::field_loader( $type ); |
| 1091 |
|
|
| 1092 |
|
$saved = null; |
| 1093 |
|
|
| 1094 |
|
if ( 1 == pods_v( 'field_save', $options, 1 ) && method_exists( self::$loaded[ $type ], 'save' ) ) |
| 1095 |
|
$saved = self::$loaded[ $type ]->save( $value, $id, $name, $options, $fields, $pod, $params ); |
| 1096 |
|
|
| 1097 |
|
return $saved; |
| 1098 |
|
} |
| 1099 |
|
|
| 1100 |
|
/** |
| 1101 |
|
* Delete the value from the DB |
|
@@ 1113-1122 (lines=10) @@
|
| 1110 |
|
* |
| 1111 |
|
* @since 2.3 |
| 1112 |
|
*/ |
| 1113 |
|
public static function delete( $type, $id = null, $name = null, $options = null, $pod = null ) { |
| 1114 |
|
self::field_loader( $type ); |
| 1115 |
|
|
| 1116 |
|
$deleted = null; |
| 1117 |
|
|
| 1118 |
|
if ( 1 == pods_v( 'field_delete', $options, 1 ) && method_exists( self::$loaded[ $type ], 'delete' ) ) |
| 1119 |
|
$deleted = self::$loaded[ $type ]->delete( $id, $name, $options, $pod ); |
| 1120 |
|
|
| 1121 |
|
return $deleted; |
| 1122 |
|
} |
| 1123 |
|
|
| 1124 |
|
/** |
| 1125 |
|
* Check if a user has permission to be editing a field |