Skip to content

Commit

Permalink
Minor updates, type hinting, to fix strict warnings in php 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
David Yell committed Mar 27, 2013
1 parent 267ffb9 commit 08f66d3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Model/Behavior/SoftDeleteBehavior.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/**
* Copyright 2007-2010, Cake Development Corporation (http://cakedc.com)
*
Expand Down Expand Up @@ -36,10 +36,10 @@ class SoftDeleteBehavior extends ModelBehavior {
/**
* Setup callback
*
* @param object $model
* @param Model $model
* @param array $settings
*/
public function setup($model, $settings = array()) {
public function setup(Model $model, $settings = array()) {
if (empty($settings)) {
$settings = $this->default;
} elseif (!is_array($settings)) {
Expand Down Expand Up @@ -67,11 +67,11 @@ public function setup($model, $settings = array()) {
/**
* Before find callback
*
* @param object $model
* @param Model $model
* @param array $query
* @return array
*/
public function beforeFind($model, $query) {
public function beforeFind(Model $model, $query) {
$runtime = $this->runtime[$model->alias];
if ($runtime) {
if (!is_array($query['conditions'])) {
Expand Down Expand Up @@ -99,11 +99,11 @@ public function beforeFind($model, $query) {
/**
* Before delete callback
*
* @param object $model
* @param Model $model
* @param array $query
* @return boolean
*/
public function beforeDelete($model) {
public function beforeDelete(Model $model, $cascade = true) {
$runtime = $this->runtime[$model->alias];
if ($runtime) {
$res = $this->delete($model, $model->id);
Expand Down Expand Up @@ -209,7 +209,7 @@ public function softDelete($model, $active) {
public function purgeDeletedCount($model, $expiration = '-90 days') {
$this->softDelete($model, false);
return $model->find('count', array(
'conditions' => $this->_purgeDeletedConditions($model, $expiration),
'conditions' => $this->_purgeDeletedConditions($model, $expiration),
'recursive' => -1));
}

Expand All @@ -223,8 +223,8 @@ public function purgeDeletedCount($model, $expiration = '-90 days') {
public function purgeDeleted($model, $expiration = '-90 days') {
$this->softDelete($model, false);
$records = $model->find('all', array(
'conditions' => $this->_purgeDeletedConditions($model, $expiration),
'fields' => array($model->primaryKey),
'conditions' => $this->_purgeDeletedConditions($model, $expiration),
'fields' => array($model->primaryKey),
'recursive' => -1));
if ($records) {
foreach ($records as $record) {
Expand Down

0 comments on commit 08f66d3

Please sign in to comment.