ActiveRecord_tm

find($options)

30: 	function find($options) {
31: 		$options = $this->Adapter->render_options($options);
32:
34: 		return $this->Adapter->select($options);
35: 	}

File: lib/model/ActiveRecord_tmp.php, #line 30

find_by_sql($sql)

40: 	function find_by_sql($sql) {
41: 		$options['sql'] = $sql;
42: 		return $this->Adapter->select($options);
43: 	}

File: lib/model/ActiveRecord_tmp.php, #line 40

save()

48: 	function save() {
49: 		Callbacks :: callback('before_validate');
50: 		Callbacks :: callback('validate_on_save');
51: 		$validation = new Validation(& $this);
52: 		Callbacks :: callback('after_validate');
53:
54: 		$this->field_error = array_merge($this->field_error, $validation->get_errors());
55: 		if ($this->field_error) {
56: 			return false;
57: 		} else {
58: 			Callbacks :: callback('before_save');
59: 			if (isset ($this->id)) {
60: 				if ($this->Adapter->update_model(& $this)) {
61: 					Callbacks :: callback('after_save');
62: 					return $this;
63: 				} else {
64: 					return false;
65: 				}
66: 			} else {
67: 				if ($this->Adapter->save_model(& $this)) {
68: 					Callbacks :: callback('after_save');
69: 					return $this;
70: 				} else {
71: 					return false;
72: 				}
73: 			}
74: 		}
75: 	}

File: lib/model/ActiveRecord_tmp.php, #line 48

update($attributes = array ())

80: 	function update($attributes = array ()) {
81: 		if ($attributes) {
82: 			foreach ($attributes as $key => $value) {
83: 				$this-> $key = $value;
84: 			}
85: 		}
86:
87: 		Callbacks :: callback('before_validate');
88: 		Callbacks :: callback('validate_on_update');
89: 		$validation = new Validation(& $this);
90: 		Callbacks :: callback('after_validate');
91: 		$this->field_error = array_merge($this->field_error, $validation->get_errors());
92:
93: 		if ($this->field_error) {
94: 			return false;
95: 		} else {
96: 			Callbacks :: callback('before_update');
97: 			if ($this->Adapter->update_model(& $this)) {
98: 				Callbacks :: callback('after_update');
99: 				return $this;
100: 			} else {
101: 				return false;
102: 			}
103: 		}
104: 	}

File: lib/model/ActiveRecord_tmp.php, #line 80

update_attributes($params)

109: 	function update_attributes($params) {
110: 		foreach ($params as $key => $value) {
111: 			$this-> $key = $value;
112: 		}
113:
114: 		Callbacks :: callback('before_validate');
115: 		Callbacks :: callback('validate_on_update');
116: 		$validation = new Validation(& $this);
117: 		Callbacks :: callback('after_validate');
118:
119: 		$this->field_error = array_merge($this->field_error, $validation->get_errors());
120:
121: 		if ($this->field_error) {
122: 			return false;
123: 		} else {
124: 			Callbacks :: callback('before_update');
125: 			if ($this->Adapter->update_model_attributes($params)) {
126: 				Callbacks :: callback('after_update');
127: 				return true;
128: 			} else {
129: 				return false;
130: 			}
131: 		}
132: 	}

File: lib/model/ActiveRecord_tmp.php, #line 109

update_all($attributes = array (), $options = array ())

137: 	function update_all($attributes = array (), $options = array ()) {
138: 		Callbacks :: callback('before_upate');
139: 		if ($this->Adapter->update_all($attributes, $options)) {
140: 			Callbacks :: callback('after_update');
141: 			return true;
142: 		} else {
143: 			return false;
144: 		}
145: 	}

File: lib/model/ActiveRecord_tmp.php, #line 137

create($params = ”)

150: 	function create($params = '') {
151: 		$class = get_class($this);
152: 		if (is_array($params)) {
153: 			$obj = new $class;
154: 			$obj->params = & $this->params;
155: 			foreach ($params as $key => $param) {
156: 				$obj-> $key = $param;
157: 			}
158: 			return $obj;
159: 		} else {
160: 			$obj = new $class;
161: 			$obj->params = & $this->params;
162: 			return $obj;
163: 		}
164: 	}

File: lib/model/ActiveRecord_tmp.php, #line 150

destroy()

169: 	function destroy() {
170: 		Callbacks :: callback('before_destroy');
171: 		if ($this->Adapter->destroy_model()) {
172: 			Callbacks :: callback('after_destroy');
173: 			$this->Adapter->destroy_has_and_belongs_to_many();
174: 			$this->Adapter->destroy_polymorphic();
175: 			return true;
176: 		} else {
177: 			return false;
178: 		}
179: 	}

File: lib/model/ActiveRecord_tmp.php, #line 169

valid($method = ”)

184: 	function valid($method = '') {
185: 		if ($method) {
186: 			if (method_exists($this, $method)) {
187: 				call_user_func(array (
188: 					$this,
189: 					$method
190: 				));
191: 			}
192: 		}
193: 		$validation = new Validation(& $this);
194: 		$this->field_error = array_merge($this->field_error, $validation->get_errors());
195: 		if ($this->field_error) {
196: 			return false;
197: 		} else {
198: 			return true;
199: 		}
200: 	}

File: lib/model/ActiveRecord_tmp.php, #line 184

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>