Permalink
Browse files

Fixed a Notice from model when ttl is not set

  • Loading branch information...
Ville Pietarinen
Ville Pietarinen committed Nov 20, 2017
1 parent 28ad6e5 commit 179de3a4c79603124ae4122fc0c8bd29d75a1434
Showing with 5 additions and 2 deletions.
  1. +3 −0 CHANGELOG.md
  2. +2 −2 classes/model.php
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
### Changed
- Fixed a Notice from `is_cacheable_function` method when `$ttl` is not set in some model
## [1.7.1] - 2017-11-03
### Changed
@@ -631,10 +631,10 @@ private function maybe_cache( $m, $data, $subs ) {
*/
private function is_cacheable_function( $m ) {
// No caching set
if ( ! isset( $this->ttl ) && ! is_array( $this->ttl ) ) {
if ( ! empty( $this->ttl ) && ! is_array( $this->ttl ) ) {
return false;
}
if ( is_array( $this->ttl ) ) {
if ( ! empty( $this->ttl ) && is_array( $this->ttl ) ) {
foreach ( $this->ttl as $key => $val ) {
if ( $m === $key ) {

0 comments on commit 179de3a

Please sign in to comment.