Skip to content

Commit

Permalink
notempty is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
webtechnick committed Oct 7, 2015
1 parent bf6841b commit f42b974
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 67 deletions.
34 changes: 17 additions & 17 deletions Model/SeoABTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class SeoABTest extends SeoAppModel {
),
),
'roll' => array(
'notempty' => array(
'rule' => array('notempty'),
'notBlank' => array(
'rule' => array('notBlank'),
'message' => 'Must have a roll must not be empty.',
),
'numberOrCallback' => array(
Expand All @@ -57,8 +57,8 @@ class SeoABTest extends SeoAppModel {
),
),
'slug' => array(
'notempty' => array(
'rule' => array('notempty'),
'notBlank' => array(
'rule' => array('notBlank'),
'message' => 'Must have a slug (custom Variable for GA)',
),
'noquotes' => array(
Expand All @@ -71,8 +71,8 @@ class SeoABTest extends SeoAppModel {
),
),
'description' => array(
'notempty' => array(
'rule' => array('notempty'),
'notBlank' => array(
'rule' => array('notBlank'),
'message' => 'Must have a description of the test.',
),
),
Expand Down Expand Up @@ -108,19 +108,19 @@ class SeoABTest extends SeoAppModel {
'order' => ''
)
);

public $searchFields = array(
'SeoUri.uri', 'SeoABTest.title', 'SeoABTest.slug', 'SeoABTest.id'
);

public $slots = array(
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
);

/**
* Validate there are no ' marks in the slug
* @return boolean success
Expand All @@ -131,7 +131,7 @@ function noquotes(){
}
return true;
}

function testableValidation(){
if(isset($this->data[$this->alias]['testable'])){
$testable = $this->data[$this->alias]['testable'];
Expand All @@ -142,7 +142,7 @@ function testableValidation(){
}
return true;
}

/**
* Validate the roll is a number between 1 and 100, or is a callback to a Model::function syntax
* @return boolean success
Expand All @@ -161,15 +161,15 @@ function numberOrCallback(){
}
return true;
}

/**
* Check if SEO already exists, if so, unset it and set the ID then save.
*/
public function beforeSave($options = array()){
$this->createOrSetUri();
return true;
}

/**
* Rolls the test roll.
* @param mixed string roll, int roll, or array test
Expand All @@ -189,7 +189,7 @@ public function roll($roll = null){
}
return false;
}

/**
* Take in a test and decide if it's testable.
* @param mixed string testable or array of test
Expand All @@ -207,7 +207,7 @@ public function isTestable($testable = null){
}
return true;
}

/**
* Find a test and roll to use it.
* @param string request (default to env('REQUEST_URI') if left null)
Expand All @@ -221,7 +221,7 @@ public function findTestableWithRoll($request = null, $debug = false){
}
return false;
}

/**
* Decide if we have a test for this request
* @param string request (optional will default to REQUEST_URI
Expand Down Expand Up @@ -271,7 +271,7 @@ public function findTestByUri($request = null, $debug = false){
))){
return $test;
}

//Check Many to Many and Many to One
$cacheEngine = SeoUtil::getConfig('cacheEngine');
if (!empty($cacheEngine)) {
Expand Down
10 changes: 5 additions & 5 deletions Model/SeoCanonical.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class SeoCanonical extends SeoAppModel {
),
),
'canonical' => array(
'notempty' => array(
'rule' => array('notempty'),
'notBlank' => array(
'rule' => array('notBlank'),
'message' => 'A canonical link must be entered',
),
),
Expand All @@ -30,22 +30,22 @@ class SeoCanonical extends SeoAppModel {
'foreignKey' => 'seo_uri_id',
)
);

/**
* Filter fields
*/
var $searchFields = array(
'SeoCanonical.id','SeoCanonical.canonical','SeoUri.uri'
);

/**
* Assign or create the url.
*/
function beforeSave($options = array()){
$this->createOrSetUri();
return true;
}

/**
* Find the first canonical link that matches this requesting URI
* @param string incoming reuqest uri
Expand Down
24 changes: 12 additions & 12 deletions Model/SeoMetaTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ class SeoMetaTag extends SeoAppModel {
),
),
'name' => array(
'notempty' => array(
'rule' => array('notEmpty'),
'notBlank' => array(
'rule' => array('notBlank'),
'message' => 'Name must be present.',
),
),
'content' => array(
'notempty' => array(
'rule' => array('notEmpty'),
'notBlank' => array(
'rule' => array('notBlank'),
'message' => 'Content must be present.',
),
),
Expand All @@ -34,19 +34,19 @@ class SeoMetaTag extends SeoAppModel {
'foreignKey' => 'seo_uri_id',
)
);

/**
* Filter fields
*/
var $searchFields = array(
'SeoMetaTag.name','SeoMetaTag.content','SeoMetaTag.id','SeoUri.uri'
);

function beforeSave($options = array()){
$this->createOrSetUri();
return true;
}

/**
* Find all the tags by a specific reuqest,
* This takes in a request URI and finds all matching meta_tags for this URI
Expand All @@ -61,24 +61,24 @@ function findAllTagsByUri($request = null){
),
'contain' => array("{$this->SeoUri->alias}.uri")
));

if(!empty($retval)){
return $retval;
}

$uri_ids = $this->SeoUri->findRegexUri($request);

if(empty($uri_ids)){
return array();
}

$retval = $this->find('all', array(
'conditions' => array(
"{$this->alias}.seo_uri_id" => $uri_ids
),
'contain' => array()
));

return $retval;
}
}
4 changes: 2 additions & 2 deletions Model/SeoRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class SeoRedirect extends SeoAppModel {
var $displayField = 'uri';
var $validate = array(
'redirect' => array(
'notempty' => array(
'rule' => array('notempty'),
'notBlank' => array(
'rule' => array('notBlank'),
'message' => 'Redirect must not be empty',
),
),
Expand Down
18 changes: 9 additions & 9 deletions Model/SeoSearchTerm.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class SeoSearchTerm extends SeoAppModel {
var $displayField = 'term';
var $validate = array(
'term' => array(
'notempty' => array(
'rule' => array('notempty'),
'notBlank' => array(
'rule' => array('notBlank'),
),
),
'uri' => array(
'notempty' => array(
'rule' => array('notempty'),
'notBlank' => array(
'rule' => array('notBlank'),
),
),
'count' => array(
Expand All @@ -25,9 +25,9 @@ class SeoSearchTerm extends SeoAppModel {
),
),
);

/**
* Take the incomming request referrer and decide if we should save this term in our
* Take the incomming request referrer and decide if we should save this term in our
* database
* @param incoming request usually $this->here
* @return void
Expand Down Expand Up @@ -74,7 +74,7 @@ function parseRequest($request = null){
}
}
}

/**
* Pull out random terms
* @param int limit
Expand All @@ -86,7 +86,7 @@ function findRandomTerms($limit = 6){
'order' => 'RAND()'
));
}

/**
* Find the top terms
* @param int limit
Expand All @@ -98,7 +98,7 @@ function findTopTerms($limit = 6){
'order' => 'SeoSearchTerm.count DESC'
));
}

/**
* Itterate the count on a specific term.
* @param int id (optional)
Expand Down
4 changes: 2 additions & 2 deletions Model/SeoTitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class SeoTitle extends SeoAppModel {
)
),
'title' => array(
'notempty' => array(
'rule' => array('notempty'),
'notBlank' => array(
'rule' => array('notBlank'),
'message' => 'Title must be present',
),
),
Expand Down
6 changes: 3 additions & 3 deletions Model/SeoUri.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class SeoUri extends SeoAppModel {
'rule' => array('isUnique'),
'message' => 'Must be a unique url'
),
'notEmpty' => array(
'rule' => array('notEmpty'),
'notBlank' => array(
'rule' => array('notBlank'),
'message' => 'Uri Must be present'
)
)
Expand Down Expand Up @@ -268,7 +268,7 @@ public function sendNotification($id = null) {
");
}
}

/**
* Given a request, see if the uri matches.
* @param string request
Expand Down
Loading

0 comments on commit f42b974

Please sign in to comment.