src/Model/Behavior/TypographicBehavior.php
public function updateTypography($dryRun = false) {
		$options = ['limit' => 100, 'offset' => 0];
		$count = 0;
		while ($records = $this->getTable()->find('all', $options)->toArray()) {
			foreach ($records as $record) {
				$changed = false;
				foreach ($this->_config['fields'] as $field) {
					if (empty($record[$field])) {
						continue;
					}
					$tmp = $this->_prepareInput($record[$field]);
					if ($tmp == $record[$field]) {
						continue;
					}
					$record[$field] = $tmp;
					$changed = true;
				}
				if ($changed) {
					if (!$dryRun) {
						$this->getTable()->save($record, ['validate' => false]);
					}
					$count++;
				}
			}
			$options['offset'] += 100;
		}
		return $count;
	}
public function updateTypography($dryRun = false) {
		$options = ['limit' => 100, 'offset' => 0];
		$count = 0;
		while ($records = $this->getTable()->find('all', $options)->toArray()) {
			foreach ($records as $record) {
				$changed = false;
				foreach ($this->_config['fields'] as $field) {
					if (empty($record[$field])) {
						continue;
					}
					$tmp = $this->_prepareInput($record[$field]);
					if ($tmp == $record[$field]) {
						continue;
					}
					$record[$field] = $tmp;
					$changed = true;
				}
				if ($changed) {
					if (!$dryRun) {
						$this->getTable()->save($record, ['validate' => false]);
					}
					$count++;
				}
			}
			$options['offset'] += 100;
		}
		return $count;
	}
public function updateTypography ( $ dryRun = false ) { $ options = [ 'limit' => 100 , 'offset' => 0 ] ; $ count = 0 ; while ( $ records = $ this -> getTable ( ) -> find ( 'all' , $ options ) -> toArray ( ) ) { foreach ( $ records as $ record ) { $ changed = false ; foreach ( $ this -> _config [ 'fields' ] as $ field ) { if ( empty ( $ record [ $ field ] ) ) { continue ; } $ tmp = $ this -> _prepareInput ( $ record [ $ field ] ) ; if ( $ tmp == $ record [ $ field ] ) { continue ; } $ record [ $ field ] = $ tmp ; $ changed = true ; } if ( $ changed ) { if ( ! $ dryRun ) { $ this -> getTable ( ) -> save ( $ record , [ 'validate' => false ] ) ; } $ count ++ ; } } $ options [ 'offset' ] += 100 ; } return $ count ; }
Run the behavior over all records of this model
This is useful if you attach it after some records have already been saved without it.

@param bool $dryRun
@return int count Number of affected/changed records
Run the behavior over all records of this model This is useful if you attach it after some records have already been saved without it .