|
@@ 1078-1085 (lines=8) @@
|
| 1075 |
|
* |
| 1076 |
|
* @since 2.0 |
| 1077 |
|
*/ |
| 1078 |
|
public static function pre_save( $type, $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
| 1079 |
|
self::field_loader( $type ); |
| 1080 |
|
|
| 1081 |
|
if ( 1 == pods_v( 'field_pre_save', $options, 1 ) && method_exists( self::$loaded[ $type ], 'pre_save' ) ) |
| 1082 |
|
$value = self::$loaded[ $type ]->pre_save( $value, $id, $name, $options, $fields, $pod, $params ); |
| 1083 |
|
|
| 1084 |
|
return $value; |
| 1085 |
|
} |
| 1086 |
|
|
| 1087 |
|
/** |
| 1088 |
|
* Save the value to the DB |
|
@@ 1103-1112 (lines=10) @@
|
| 1100 |
|
* |
| 1101 |
|
* @since 2.3 |
| 1102 |
|
*/ |
| 1103 |
|
public static function save( $type, $value, $id = null, $name = null, $options = null, $fields = null, $pod = null, $params = null ) { |
| 1104 |
|
self::field_loader( $type ); |
| 1105 |
|
|
| 1106 |
|
$saved = null; |
| 1107 |
|
|
| 1108 |
|
if ( 1 == pods_v( 'field_save', $options, 1 ) && method_exists( self::$loaded[ $type ], 'save' ) ) |
| 1109 |
|
$saved = self::$loaded[ $type ]->save( $value, $id, $name, $options, $fields, $pod, $params ); |
| 1110 |
|
|
| 1111 |
|
return $saved; |
| 1112 |
|
} |
| 1113 |
|
|
| 1114 |
|
/** |
| 1115 |
|
* Delete the value from the DB |
|
@@ 1127-1136 (lines=10) @@
|
| 1124 |
|
* |
| 1125 |
|
* @since 2.3 |
| 1126 |
|
*/ |
| 1127 |
|
public static function delete( $type, $id = null, $name = null, $options = null, $pod = null ) { |
| 1128 |
|
self::field_loader( $type ); |
| 1129 |
|
|
| 1130 |
|
$deleted = null; |
| 1131 |
|
|
| 1132 |
|
if ( 1 == pods_v( 'field_delete', $options, 1 ) && method_exists( self::$loaded[ $type ], 'delete' ) ) |
| 1133 |
|
$deleted = self::$loaded[ $type ]->delete( $id, $name, $options, $pod ); |
| 1134 |
|
|
| 1135 |
|
return $deleted; |
| 1136 |
|
} |
| 1137 |
|
|
| 1138 |
|
/** |
| 1139 |
|
* Check if a user has permission to be editing a field |