Search for intermediate shape model by its c2j name.

@return ShapeModel
@throws IllegalArgumentException
if the specified c2j name is not found in the intermediate model.
493202
public static ShapeModel findShapeModelByC2jName(IntermediateModel intermediateModel, String shapeC2jName)
            throws IllegalArgumentException {
        ShapeModel shapeModel = findShapeModelByC2jNameIfExists(intermediateModel, shapeC2jName);
        if (shapeModel != null) {
            return shapeModel;
        } else {
            throw new IllegalArgumentException(
                    shapeC2jName + " shape (c2j name) does not exist in the intermediate model.");
        }
    }
719637
public function getQueryBuilder()
    {
        if (null === $this->queryBuilder) {
            $builder = QueryBuilderFactory::getQueryBuilder($this->getConnection());
            $this->setTableAlias($builder, $this->getModel()->tableName());
            $builder->setAlias($this->getTableAlias());
            $model = $this->getModel();
            $meta = $model->getMeta();
            $builder->table($model->tableName());

            $fetchColumnCallback = new FetchColumnCallback($model, $meta);
            $callback = new LookupCallback($model);
            $joinCallback = new JoinCallback($model);
            $builder
                ->getLookupBuilder()
                ->setFetchColumnCallback($fetchColumnCallback)
                ->setCallback($callback)
                ->setJoinCallback($joinCallback);
            $this->queryBuilder = $builder;
        }

        return $this->queryBuilder;
    }
78649
public function getForeignModel()
    {
        $model = $this->getFullForeignModel();

        if ($this->isModel($model)) {
            return class_basename($model);
        }

        $position = strrpos($model, '\\');

        if ($position !== false) {
            return substr($model, $position + 1);
        }

        return '';
    }
854569
public boolean getFeature(String name) throws IllegalArgumentException {
		if (name == null) {
			throw new IllegalArgumentException("feature name can not be null");
		}
		if (FEATURE_NAMES_INTERNED.equals(name)) {
			return namesInterned;
		} else if (FEATURE_SERIALIZER_ATTVALUE_USE_APOSTROPHE.equals(name)) {
			return attributeUseApostrophe;
		} else {
			return false;
		}
	}
101366
public function findByComponentName($name = null)
    {
        return $this->model->with('component', 'priority', 'brand', 'jobs')->whereHas('component', function($q) use($name) {
                    $q->where('active', 1);
                    if (!is_null($name)) {
                        $q->where('name', $name);
                    }
                })->where('brand_id', brand_id());
    }
285831
public function getModelInstance()
    {
        if ($this->instance !== null) {
            return $this->instance;
        }
        $model = $this->getModel();
        if ($model === false) {
            return false;
        }
        $instance = new $model();

        return $instance;
    }
1240735
public function GetCustomImportModel() {
      $Header = $this->GetImportHeader();
      $Source = GetValue('Source', $Header, '');
      $Result = NULL;

      if (substr_compare('vbulletin', $Source, 0, 9, TRUE) == 0)
         $Result = new vBulletinImportModel();
      elseif (substr_compare('vanilla 1', $Source, 0, 9, TRUE) == 0)
         $Result = new Vanilla1ImportModel();

      if ($Result !== NULL)
         $Result->ImportModel = $this;

      return $Result;
   }
1152048
protected function getModelNamespace()
    {
        /** @var TableMap $tableMap */
        $tableMap = $this->getModelTableMap();
        return (null !== $tableMap) ? $tableMap::getOMClass(FALSE) : null;
    }
6314
public static ShapeModel findShapeModelByC2jNameIfExists(IntermediateModel intermediateModel, String shapeC2jName) {
        for (ShapeModel shape : intermediateModel.getShapes().values()) {
            if (shape.getC2jName().equals(shapeC2jName)) {
                return shape;
            }
        }
        return null;
    }
1313347
protected function getItemModel() {
		try {
			return $this->getItem()->getUniquePropertyValue(new core_kernel_classes_Property(taoItems_models_classes_ItemsService::PROPERTY_ITEM_MODEL));
		} 
		catch (common_Exception $e) {
			return null;
		}
	}
307601
public ModelDescription getModelDescription() {
        String modelName = retrieveModelName();
        String modelVersion = retrieveModelVersion();
        if (modelName == null || modelVersion == null) {
            throw new IllegalArgumentException("Unsufficient information to create model description.");
        }
        return new ModelDescription(modelName, modelVersion);
    }
640560
public String getJavaDataType(Map<String, Shape> shapes, String shapeName,
                                  CustomizationConfig customConfig) {

        if (shapeName == null || shapeName.trim().isEmpty()) {
            throw new IllegalArgumentException(
                    "Cannot derive shape type. Shape name cannot be null or empty");
        }

        final Shape shape = shapes.get(shapeName);

        if (shape == null) {
            throw new IllegalArgumentException(
                    "Cannot derive shape type. No shape information available for " + shapeName);
        }

        final String shapeType = shape.getType();

        if (Structure.getName().equals(shapeType)) {
            return namingStrategy.getJavaClassName(shapeName);
        } else if (List.getName().equals(shapeType)) {
            String listType =
                    customConfig != null && customConfig.isUseAutoConstructList() ? LIST_AUTO_CONSTRUCT_IMPL : LIST_INTERFACE;
            final String listContainerType = dataTypeMappings.get(listType);
            return listContainerType + "<" +
                   getJavaDataType(shapes, shape.getListMember().getShape()) + ">";
        } else if (Map.getName().equals(shapeType)) {
            String mapType =
                    customConfig != null && customConfig.isUseAutoConstructMap() ? MAP_AUTO_CONSTRUCT_IMPL : MAP_INTERFACE;
            final String mapContainerType = dataTypeMappings.get(mapType);
            return mapContainerType + "<" +
                   getJavaDataType(shapes, shape.getMapKeyType().getShape()) + "," +
                   getJavaDataType(shapes, shape.getMapValueType().getShape()) + ">";
        } else {

            if (shape.isStreaming()) {
                return dataTypeMappings.get("stream");
            }

            // scalar type.
            final String dataType = dataTypeMappings.get(shapeType);
            if (dataType == null) {
                throw new RuntimeException(
                        "Equivalent Java data type cannot be found for data type : " + shapeType);
            }
            return dataType;
        }
    }
1336840
public function getModel()
    {
        if ($this->model == null) {
            $name = $this->relation->getReferencedModel();
            $this->model = new $name();
        }
        return $this->model;
    }
459119
public Transformation<?, Shape> getTransform(String name)
	{
		Transform t = transforms.get(name);
		if (t == null)
			return null;
		return t.getTransformation(name, this);
	}
333092
private function getAlgoliaRecordsFromSearchableModelArray(array $searchableModels)
    {
        if (empty($searchableModels)) {
            throw new \InvalidArgumentException('The given array should not be empty');
        }

        // Use the first element of the array to define what kind of models we are indexing.
        $arrayType = \get_class($searchableModels[0]);
        $this->checkImplementsSearchableInterface($arrayType);

        return \array_map(function (SearchableInterface $searchableModel) use ($arrayType) {
            if (! $searchableModel instanceof $arrayType) {
                throw new \InvalidArgumentException('The given array should not contain multiple different classes');
            }

            $algoliaRecord = $searchableModel->getAlgoliaRecord();
            $algoliaRecord['objectID'] = $searchableModel->getObjectID();

            return $algoliaRecord;
        }, $searchableModels);
    }
235076
protected function getModel()
    {
        $modelClass = trim($this->argument('model'));

        $modelInstance = new $modelClass;

        if (
            ! ($modelInstance instanceof Model) ||
            ! in_array(Searchable::class, class_uses_recursive($modelClass))
        ) {
            throw new InvalidArgumentException(sprintf(
                'The %s class must extend %s and use the %s trait.',
                $modelClass,
                Model::class,
                Searchable::class
            ));
        }

        return $modelInstance;
    }
427393
protected function getModel()
	{
		if (!$model = $this->owner) {
			throw new \Exception('Model is not been initialized properly.');
		}
		if (!$model instanceof ActiveRecord) {
			throw new \Exception(sprintf('Behavior must be applied to the ActiveRecord model class and it\'s iheritants, the unsupported class provided: `%s`', get_class($model)));
		}

		return $model;
	}