Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Method.TestExtra.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Extra attribute test
8  *
9  * @author Anakeen
10  *
11  * @package Dcp\Pu
12  */
13 /**
14  * @begin-method-ignore
15  * this part will be deleted when construct document class until end-method-ignore
16  */
17 class _TEST_EXTRA extends Doc
18 {
19  /**
20  * @end-method-ignore
21  */
22 
23  public function preImport(array $extra=array())
24  {
25  $err = parent::preImport($extra);
26  if ($err == "") {
27  if (empty($extra) || empty($extra["state"]) || ($extra["state"] != "alive" && $extra["num"] == "1") || ($extra["state"] != "sick" && $extra["num"] == "2")) {
28  return _("TEST_EXTRA:Extra state not found");
29  }
30  }
31  return $err;
32  }
33 
34  public function postImport(array $extra=array())
35  {
36  $err = parent::postImport($extra);
37  if ($err == "") {
38  $err = $this->SetValue("test_extra", json_encode($extra));
39  if ($err == "") {
40  $err = $this->store();
41  }
42  }
43  return $err;
44  }
45  /**
46  * @begin-method-ignore
47  * this part will be deleted when construct document class until end-method-ignore
48  */
49 }
50 /**
51  * @end-method-ignore
52  */
preImport(array $extra=array())
postImport(array $extra=array())
store(&$info=null, $skipConstraint=false)
Definition: Class.Doc.php:1308
if($file) if($subject==""&&$file) if($subject=="") $err
← centre documentaire © anakeen