belongsTo[$relationName]['foreignKey']; $search[$relationName.'.'.$this->{$relationName}->primaryKey] = $data[$field]; return $this->{$relationName}->find('count',array('conditions' => $search)); } var $inserted_ids = array(); function afterSave($created) { if($created) { $this->inserted_ids[] = $this->getInsertID(); } return true; } /** * * Remove todos os relacionamentos do modelo */ function unbindModelAll() { $unbind = array(); foreach ($this->belongsTo as $model=>$info) { $unbind['belongsTo'][] = $model; } foreach ($this->hasOne as $model=>$info) { $unbind['hasOne'][] = $model; } foreach ($this->hasMany as $model=>$info) { $unbind['hasMany'][] = $model; } foreach ($this->hasAndBelongsToMany as $model=>$info) { $unbind['hasAndBelongsToMany'][] = $model; } parent::unbindModel($unbind); } /** * Recupera todas as Categoria * * @param int $status ( 0: Inativo , 1: Ativo , -1 : Ambos ) * @param array $order */ function getAll($status = -1 , $fields = null , $order = null ){ $options['conditions'] = array(); if ($fields == null){ $options['fields'] = array( $this->name.'.'.$this->primaryKey, $this->name.'.'.$this->mainField ); }else{ $options['fields'] = $fields; } if ($order == null){ $options['order'] = array( $this->name.'.'.$this->mainField ); }else{ $options['order'] = $order; } if ( $status != $this->BOTH ) $options['conditions'] = array_merge( $options['conditions'] , array( $this->name.'.status'=>$status ) ); return $this->find("list" , $options ); } } ?> .:: DEART - Departamento de Artes da UFRN ::.

Telefone/Fax: +55 84 3215 3550

Email: deart@cchla.ufrn.br