|
@@ 1070-1077 (lines=8) @@
|
| 1067 |
|
* |
| 1068 |
|
* @since 2.0 |
| 1069 |
|
*/ |
| 1070 |
|
public static function pre_save( $type, $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
| 1071 |
|
self::field_loader( $type ); |
| 1072 |
|
|
| 1073 |
|
if ( 1 == pods_v( 'field_pre_save', $options, 1 ) && method_exists( self::$loaded[ $type ], 'pre_save' ) ) |
| 1074 |
|
$value = self::$loaded[ $type ]->pre_save( $value, $id, $name, $options, $fields, $pod, $params ); |
| 1075 |
|
|
| 1076 |
|
return $value; |
| 1077 |
|
} |
| 1078 |
|
|
| 1079 |
|
/** |
| 1080 |
|
* Save the value to the DB |
|
@@ 1095-1104 (lines=10) @@
|
| 1092 |
|
* |
| 1093 |
|
* @since 2.3 |
| 1094 |
|
*/ |
| 1095 |
|
public static function save( $type, $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
| 1096 |
|
self::field_loader( $type ); |
| 1097 |
|
|
| 1098 |
|
$saved = null; |
| 1099 |
|
|
| 1100 |
|
if ( 1 == pods_v( 'field_save', $options, 1 ) && method_exists( self::$loaded[ $type ], 'save' ) ) |
| 1101 |
|
$saved = self::$loaded[ $type ]->save( $value, $id, $name, $options, $fields, $pod, $params ); |
| 1102 |
|
|
| 1103 |
|
return $saved; |
| 1104 |
|
} |
| 1105 |
|
|
| 1106 |
|
/** |
| 1107 |
|
* Delete the value from the DB |
|
@@ 1119-1128 (lines=10) @@
|
| 1116 |
|
* |
| 1117 |
|
* @since 2.3 |
| 1118 |
|
*/ |
| 1119 |
|
public static function delete( $type, $id = null, $name = null, $options = null, $pod = null ) { |
| 1120 |
|
self::field_loader( $type ); |
| 1121 |
|
|
| 1122 |
|
$deleted = null; |
| 1123 |
|
|
| 1124 |
|
if ( 1 == pods_v( 'field_delete', $options, 1 ) && method_exists( self::$loaded[ $type ], 'delete' ) ) |
| 1125 |
|
$deleted = self::$loaded[ $type ]->delete( $id, $name, $options, $pod ); |
| 1126 |
|
|
| 1127 |
|
return $deleted; |
| 1128 |
|
} |
| 1129 |
|
|
| 1130 |
|
/** |
| 1131 |
|
* Check if a user has permission to be editing a field |