| @@ -142,11 +142,11 @@ | ||
| 142 | 142 | * put your comment there... |
| 143 | 143 | * |
| 144 | 144 | * @deprecated Use calculatePinpoint |
| 145 | 145 | */ |
| 146 | - public static function calculateBlockPinPoint(&$block) { | |
| 146 | + public static function calculateBlockPinPoint(& $block) { | |
| 147 | 147 | // Generate PinPoint Value. |
| 148 | - if (is_array($block->pinPoint)) { | |
| 148 | + if (isset($block->pinPoint) && is_array($block->pinPoint)) { | |
| 149 | 149 | $pinPoint = 0; |
| 150 | 150 | // Each item is a bit flag. |
| 151 | 151 | foreach ($block->pinPoint as $pin) { |
| 152 | 152 | $pinPoint |= hexdec($pin); |
| @@ -152,9 +152,12 @@ | ||
| 152 | 152 | $pinPoint |= hexdec($pin); |
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | else { |
| 156 | - // If provided as integer. | |
| 156 | + // Provided as integer or not even provided! | |
| 157 | + if (!isset($block->pinPoint)) { | |
| 158 | + $block->pinPoint = 0; | |
| 159 | + } | |
| 157 | 160 | $pinPoint = (int) $block->pinPoint; |
| 158 | 161 | } |
| 159 | 162 | // Pin should be set only for not empty properties. |
| 160 | 163 | // This help us retreiving only needed blocks when outputing blocks code. |
| @@ -185,15 +188,6 @@ | ||
| 185 | 188 | $pinPoint = self::calculateBlockPinPoint($block)->pinPoint; |
| 186 | 189 | // Return only pinPoint. |
| 187 | 190 | return $pinPoint; |
| 188 | 191 | } |
| 189 | - | |
| 190 | - /** | |
| 191 | - * put your comment there... | |
| 192 | - * | |
| 193 | - * @param mixed $values | |
| 194 | - */ | |
| 195 | - public static function getInstance($values) { | |
| 196 | - return new CJTBlockModel($values); | |
| 197 | - } | |
| 198 | - | |
| 192 | + | |
| 199 | 193 | } // End class. |