|
@@ 1090-1097 (lines=8) @@
|
| 1087 |
|
* |
| 1088 |
|
* @since 2.0 |
| 1089 |
|
*/ |
| 1090 |
|
public static function pre_save( $type, $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
| 1091 |
|
self::field_loader( $type ); |
| 1092 |
|
|
| 1093 |
|
if ( 1 == pods_v( 'field_pre_save', $options, 1 ) && method_exists( self::$loaded[ $type ], 'pre_save' ) ) |
| 1094 |
|
$value = self::$loaded[ $type ]->pre_save( $value, $id, $name, $options, $fields, $pod, $params ); |
| 1095 |
|
|
| 1096 |
|
return $value; |
| 1097 |
|
} |
| 1098 |
|
|
| 1099 |
|
/** |
| 1100 |
|
* Save the value to the DB |
|
@@ 1115-1124 (lines=10) @@
|
| 1112 |
|
* |
| 1113 |
|
* @since 2.3 |
| 1114 |
|
*/ |
| 1115 |
|
public static function save( $type, $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
| 1116 |
|
self::field_loader( $type ); |
| 1117 |
|
|
| 1118 |
|
$saved = null; |
| 1119 |
|
|
| 1120 |
|
if ( 1 == pods_v( 'field_save', $options, 1 ) && method_exists( self::$loaded[ $type ], 'save' ) ) |
| 1121 |
|
$saved = self::$loaded[ $type ]->save( $value, $id, $name, $options, $fields, $pod, $params ); |
| 1122 |
|
|
| 1123 |
|
return $saved; |
| 1124 |
|
} |
| 1125 |
|
|
| 1126 |
|
/** |
| 1127 |
|
* Delete the value from the DB |
|
@@ 1139-1148 (lines=10) @@
|
| 1136 |
|
* |
| 1137 |
|
* @since 2.3 |
| 1138 |
|
*/ |
| 1139 |
|
public static function delete( $type, $id = null, $name = null, $options = null, $pod = null ) { |
| 1140 |
|
self::field_loader( $type ); |
| 1141 |
|
|
| 1142 |
|
$deleted = null; |
| 1143 |
|
|
| 1144 |
|
if ( 1 == pods_v( 'field_delete', $options, 1 ) && method_exists( self::$loaded[ $type ], 'delete' ) ) |
| 1145 |
|
$deleted = self::$loaded[ $type ]->delete( $id, $name, $options, $pod ); |
| 1146 |
|
|
| 1147 |
|
return $deleted; |
| 1148 |
|
} |
| 1149 |
|
|
| 1150 |
|
/** |
| 1151 |
|
* Check if a user has permission to be editing a field |