コード例 #1
0
 /**
  * @param Field $field
  * @param ContextContract $context
  * @return bool
  */
 private function isWritable(Field $field, Context $context)
 {
     return $field->shouldInclude($context, $this->currentPath);
 }
コード例 #2
0
 /**
  * @param Context $context
  * @param CurrentPath $currentPath
  * @return bool
  */
 public function shouldInclude(Context $context, CurrentPath $currentPath)
 {
     // Check for max depth.
     if ($maxDepth = $this->getMaxDepth()) {
         $existing = $currentPath->countSame($this);
         if ($existing > $maxDepth) {
             return false;
         }
     }
     return parent::shouldInclude($context, $currentPath);
 }